mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@1 a5845835-ea0f-0410-a762-dd0bfe9bfde8
27 lines
484 B
PHP
27 lines
484 B
PHP
<?php
|
|
|
|
class speedometer {
|
|
|
|
var $digits = 6;
|
|
|
|
var $start;
|
|
var $time;
|
|
|
|
function speedometer ($digits=false) {
|
|
if ( !empty($digits) ) $this->digits = $digits;
|
|
$this->start = $this->getmicrotime();
|
|
}
|
|
|
|
function end () {
|
|
$end = $this->getmicrotime();
|
|
return $this->time = number_format( ($end - $this->start), $this->digits);
|
|
}
|
|
|
|
function getmicrotime () {
|
|
list($usec, $sec) = explode(' ', microtime());
|
|
$r = floatval($usec) + floatval($sec);
|
|
return($r);
|
|
}
|
|
}
|
|
|
|
?>
|