note 99307 added to function.microtime
| From: | Andris at osu1 dot php dot net | Date: | Tue, 10 Aug 2010 09:23:56 +0000 |
| Subject: | note 99307 added to function.microtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171507@lists.php.net to get a copy of this message | ||
I wrote a class which allows to time execution of php scripts very easily. You can even time
multiple separate blocks and then get the total time at the end.
The class is pretty long so I won't post it here, but here's the link:
http://codeaid.net/php/calculate-script-execution-time-(php-class)
An quick usage example:
<?php
for ($i = 0; $i < 100; $i++) {
// calculate the time it takes to run fx()
Timer::start();
fx();
Timer::stop();
fy();
// calculate the time it takes to run fz()
Timer::start();
fz();
Timer::stop();
}
print Timer::get();
----
Server IP: 92.48.74.199
Probable Submitter: 62.172.163.242
----
Manual Page -- http://www.php.net/manual/en/function.microtime.php
Edit -- https://master.php.net/note/edit/99307
Del: integrated -- https://master.php.net/note/delete/99307/integrated
Del: useless -- https://master.php.net/note/delete/99307/useless
Del: bad code -- https://master.php.net/note/delete/99307/bad+code
Del: spam -- https://master.php.net/note/delete/99307/spam
Del: non-english -- https://master.php.net/note/delete/99307/non-english
Del: in docs -- https://master.php.net/note/delete/99307/in+docs
Del: other reasons-- https://master.php.net/note/delete/99307
Reject -- https://master.php.net/note/reject/99307
Search -- https://master.php.net/manage/user-notes.php