note 11862 deleted from function.microtime.php by ronabop

From: Date: Sat, 10 Mar 2001 23:29:00 +0000
Subject: note 11862 deleted from function.microtime.php by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-12234@lists.php.net to get a copy of this message
This should do the trick (the same as above just shortened. function getmicrotime(){ list($sec, $usec) = explode(" ",microtime()); return ($sec + $usec); } then set somewhere a start point in your script where the measure should start. (something akin to this $time_start = getmicrotime();) and of course where the measure should stopp.( $time_end = getmicrotime(); ) underneath place this one $time = $time_end - $time_start; Now evaluate $time, that's it. Notice that if you are measuring a long time period (10 sec and over) i wouldn't recommend to measure with microtime(), use the normal time stamp instead. Then all you have to do is: $time_start = time(); ....your code.... $time_end = time(); $time = $time_end - $time_start;

« previous php.notes (#12234) next »