PHP code example of drealecs / time-benchmark

1. Go to this page and download the library: Download drealecs/time-benchmark 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/ */

    

drealecs / time-benchmark example snippets

 php
$stopwatch = Stopwatch::create();
 php
$stopwatch = Stopwatch::createStarted();
 php
$stopwatch->start();
 php
$stopwatch->stop();
 php
$seconds = $stopwatch->getElapsedSeconds();
$milliseconds = $stopwatch->getElapsedMilliseconds();
$microseconds = $stopwatch->getElapsedMicroseconds();
 php
$stopwatch->wasStarted();
$stopwatch->isRunning();
$stopwatch->wasStopped();
 php
$stopwatch->step($stepName);
 php
$stopwatch->getStepsNumber();
 php
$seconds = $stopwatch->getElapsedStepsSeconds();
$milliseconds = $stopwatch->getElapsedStepsMilliseconds();
$microseconds = $stopwatch->getElapsedStepsMicroseconds();
 php
$stopwatch->pause();
$stopwatch->resume();