A modest collection of PHP libraries used at SparkFun.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

29 lines
431 B

<?php
namespace SparkLib\Util;
class Timer {
private $_startTime = null;
public function __construct ()
{
$this->reset();
}
public function reset ()
{
$time = microtime();
$time = explode(' ', $time);
$this->_startTime = $time[1] + $time[0];
}
public function spent ()
{
$time = microtime();
$time = explode(' ', $time);
return ($time[1] + $time[0]) - $this->_startTime;
}
}