A simple Stopwatch utility for PHP
$start = StopWatch::start();
$start = StopWatch::start();
sleep(3); // Sleep 3 seconds for testing
$end = Stopwatch::stop($start);
echo 'Elapsed: '.$end; //Elapsed: 0 hours, 0 minutes and 3 seconds
$start = StopWatch::start();
sleep(3); // Sleep 3 seconds for testing
$end = Stopwatch::stop($start, true, 's');
echo 'Elapsed Seconds: '.$end; //Elapsed Seconds: 3
$current = StopWatch::current();
echo $current; //2018-10-04 10:37:30.271700