note 51605 added to function.microtime

From: Date: Tue, 05 Apr 2005 15:59:29 +0000
Subject: note 51605 added to function.microtime
Groups: php.notes 
Request: Send a blank email to php-notes+get-87503@lists.php.net to get a copy of this message
The code provided by joelatlearnossdotcom is incorrect. That will only produce the microseconds of the current time. Here's what it should look like: <? $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; // -------------- // your code here // -------------- $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 6); ?> with $total_time being the script execution time. ---- Manual Page -- http://www.php.net/manual/en/function.microtime.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51605 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51605&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51605&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51605&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51605&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51605&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51605&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#87503) next »