Karam Chand wrote:
In Win32 API to profile a job we use the following
method:


timetaken = GetTickCount(); /* do some job */ timetaken = GetTickCount() - timetaken;

In this way timetaken returns you the time taken by
the job to complete?

How can I get it in PHP. I want the exact figure in
ms? I used microtime() and the samples given in
php.net but none of them correctly returns the
difference only in ms?

Read the manual page again. Use the example to get the microtime as a float at the start and then after your job. Subtract to get the difference. If you're using PHP5, just use microtime(TRUE); to get the float value.


--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to