PHP code example of shiishiji / timer

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

    

shiishiji / timer example snippets


$timer = new StopWatch();

$timer->start();
sleep(1); // perform action to be measured
$timer->stop();

$result = $timer->getDuration();
var_dump($result); // prints something like -> string(10) "1000273951"
bash
docker build -t php_timer .
bash
docker run --rm -it php_timer vendor/bin/phpunit tests