PHP code example of ershov-ilya / timer.class.php

1. Go to this page and download the library: Download ershov-ilya/timer.class.php 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/ */

    

ershov-ilya / timer.class.php example snippets


$timer->start('mysql.sql.query.response.parsing', true); // Second parameter in "true" says to start all parent-timers
$timer->stopTree('mysql'); // Stop timers tree "mysql"


$timer=new Timer(array(
'debug'=>true
));
$timer->start('mysql.sql.query.response.parsing',true);
$timer->start('postgres.sql.query.response.parsing');
usleep(200000);
print_r($timer->data());
print $timer;
$timer->start('file.read');
$timer->stopTree('mysql');
usleep(300000);
print_r($timer->data());

$config=array(
    'query_delimiter'   =>  '.',
    'output_delimiter'  =>  '=',
    'add_children_time' => true,
    'debug'             => false
);
$timer=new Timer($config);