- made simple template almost feature complete by implementing view modes and more

- other general fixes to things a bit all over the place

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@12 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-04-04 23:15:55 +00:00
parent a8fe6d5a8c
commit 80fd008b9d
20 changed files with 411 additions and 105 deletions

View File

@@ -4,12 +4,13 @@ class speedometer {
/*
Class: Speedometer v0.1.1
Class: Speedometer v0.2
Created to simplify script execution statistics...
*/
var $digits = 6;
var $pattern = '%s'; // must contain %s
var $start;
var $time;
@@ -19,7 +20,17 @@ class speedometer {
$this->start = $this->getmicrotime();
}
function end ($digits=false) {
// return with pattern
function end ($digits=false, $pattern=false) {
$end = $this->getmicrotime();
$digits = ( preg_match("/[0-9]{1,2}/", $digits) ) ? $digits : $this->digits ;
$pattern = ( stristr($pattern, '%s') != false ) ? $pattern : $this->pattern ;
$this->time = number_format( ($end - $this->start), $digits);
return str_replace('%s', $this->time, $pattern);
}
// return time only ignoring pattern
function term ($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);