mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
- removed timer.exc.php and put the needed intializer directly in view.php to get a more accurate reading from $timer->end() - updated .htaccess settings to they for once work 100% as they should, and added httpd_dlist.conf to respository to keep track of any changes/updates needed to the .htaccess file or apache config file (depending how you implement dList) git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@11 a5845835-ea0f-0410-a762-dd0bfe9bfde8
35 lines
660 B
PHP
35 lines
660 B
PHP
<?php
|
|
|
|
class speedometer {
|
|
|
|
/*
|
|
|
|
Class: Speedometer v0.1.1
|
|
Created to simplify script execution statistics...
|
|
|
|
*/
|
|
|
|
var $digits = 6;
|
|
|
|
var $start;
|
|
var $time;
|
|
|
|
function speedometer ($digits=false) {
|
|
if ( !empty($digits) ) $this->digits = $digits;
|
|
$this->start = $this->getmicrotime();
|
|
}
|
|
|
|
function end ($digits=false) {
|
|
$end = $this->getmicrotime();
|
|
$digits = ( preg_match("/[0-9]{1,2}/", $digits) ) ? $digits : $this->digits ;
|
|
return $this->time = number_format( ($end - $this->start), $digits);
|
|
}
|
|
|
|
function getmicrotime () {
|
|
list($usec, $sec) = explode(' ', microtime());
|
|
$r = floatval($usec) + floatval($sec);
|
|
return($r);
|
|
}
|
|
}
|
|
|
|
?>
|