|
|
#1 (permalink) |
|
co-admin
Join Date: Oct 2006
Location: Belgium
Posts: 666
|
This timer is easy to implement and determines the time taken for a php script to execute correct to a microsecond.
Insert this code at the top of the page: PHP Code:
PHP Code:
Now lets break this code down, so you can understand it. I retrieve the microtime at the tope of the page, and the end of the page by using PHP's microtime() function. PHP's microtime() function returns the current Unix timestamp with microseconds. Then I use the explode() function, to turn the string into an array. After that, I add the two parts of the array together, and assign a variable. I do the same at the end of the document. Then I subtract the two times, and we have our loaded time! |
|
|
|