mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
Initial import
git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@1 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
27
libs/speedometer.lib.php
Normal file
27
libs/speedometer.lib.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user