PHP code example of tox82 / server-timing-helper

1. Go to this page and download the library: Download tox82/server-timing-helper 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/ */

    

tox82 / server-timing-helper example snippets


\Tox82\ServerTiming::profile('metricName');
# ... your code here ...
\Tox82\ServerTiming::profile('metricName');

\Tox82\ServerTiming::start('metricName');
# ... your code here ...
\Tox82\ServerTiming::stop('metricName');

\Tox82\ServerTiming::log('heavyBlocks');
# foreach ($items as $item) {
\Tox82\ServerTiming::log('    singleBlock');
# ... your code here ...
\Tox82\ServerTiming::log('    singleBlock');
# }
\Tox82\ServerTiming::log('heavyBlocks');

\Tox82\ServerTiming::setLogFile('/var/www/server_timing.log');