1. Go to this page and download the library: Download nullform/app-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/ */
nullform / app-timer example snippets
use Nullform\AppTimer;
$timer = new AppTimer\Timer("New timer");
$timer->start("First interval");
// Some code...
$interval = $timer->stop(); // Instance of Interval
$timer->start("Second interval");
// Some code...
$duration = $timer->stop()->duration; // float
$report = $timer->report(); // Instance of Report
$timer->start("First interval"); // Parent interval
$timer->start("First nested interval");
// Some code...
$timet->stop(); // Stop first nested interval
$timer->start("Second nested interval");
// Some code...
$timet->stop(); // Stop second nested interval
$timer->stop(); // Stop parent interval
$report = $timer->report(); // Instance of Report