PHP code example of enricospa / microtime-tracker

1. Go to this page and download the library: Download enricospa/microtime-tracker 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/ */

    

enricospa / microtime-tracker example snippets


   use Enricospa\MicrotimeTracker\Tracker;
   use Enricospa\MicrotimeTracker\TimestampHolder;

   // Init the tracker
   $tracker = new Tracker(new TimestampHolder);

   // First snap starts the tracker
   $tracker->snap('Start tracking');

   // Sleep for a while
   usleep(2000000);

   $tracker->snap('Slept for a while');

   echo "<pre>";
   echo $tracker->reportConsole();
   echo "</pre>";