<?php
class page_gen {
//
// PRIVATE - DO NOT MODIFY
//
var $cls_start_time;
var $cls_stop_time;
var $cls_gen_time;
//
// FIGURE OUT THE TIME AT THE BEGINNING OF THE PAGE
//
function start() {
$microstart = explode(' ',microtime());
$this->cls_start_time = $microstart[0] + $microstart[1];
}
//
// FIGURE OUT THE TIME AT THE END OF THE PAGE
//
function stop() {
$microstop = explode(' ',microtime());
$this->cls_stop_time = $microstop[0] + $microstop[1];
}
//
// CALCULATE THE DIFFERENCE BETWEEN THE BEGINNNG AND THE END AND COLOR CODE THE RESULT
//
function gen() {
$this->cls_gen_time = $this->cls_stop_time - $this->cls_start_time;
return $this->cls_gen_time;
}
}
?>
What happens is it simply returns the $this->cls_start_time variable.
Both the start() and stop() functions work fine because to test them I put print commands at the end and they both returned proper results, the error appears to be in the line where I minus the start time from the end time. It simply returns a negative start time instead of minusing the two.
I tried changing the minus to a plus for testing sake and it just took out the negative. Does anybody have any idea what is going on here? Thanks-you
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php