webCOMAND

time::get_duration()

Returns a formatted duration of time passed between a time returned by get_time() and the current time, or a specific end time also returned by get_time().

Prototype

string static get_duration(long $start_time, long $end_time = NULL)

Example

use io_comand_util\time;

$start = time::get_time();
sleep(2);
echo( "Slept for " . time::get_duration($start) . "\n" );