PHP code example of jopmesman / logtimer

1. Go to this page and download the library: Download jopmesman/logtimer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jopmesman / logtimer example snippets


LogTimer::time('Complete process');
LogTimer::time('Get all rows from the database');
$data = getAllDataFromDB();
LogTimer::time('Get all rows from the database');
//Loop over all the rows from the database
LogTimer::time('Looping');
$return = [];
foreach ($data as $row) {
    $return[$row['id']] = $row['name'];
}
LogTimer::time('Looping');
LogTimer::time('Complete process');

print_r(LogTimer::times());