You will need to call microtime() at the beginning and end then subtract

$startTime = microtime(true);

doSomething():

$executionTime = microtime(true) - $startTime;

echo "Page Generated In $executionTime Seconds";

Just for clarification -- this doesn't give you an accurate time of how long it takes for your server to handle a given request, only the execution time. Since PHP, as a script language, has a lot of overhead, the actual execution of the script is only part of it. That's not even getting into the web server piece, or the client side.

Anyway, the original request was for 'load time', not 'execution time', so I figured I'd mention it.

Ben


_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to