Calculation Your PHP Processing Time Using Simple Counter
October 27th, 2008
4 comments
It’s a good idea for PHP progammer to know how fast their application process. With this info they can decide what best coding to achieve high perfomance. We’ll using microtime() function that’s already exist in PHP. Microtime will returns the current timestamp with microseconds.
The basic idea is when first PHP running the process, counting function will work and note as begin time and when process is finished counting function call again and note as end time. From this two variable we can get all processing time by decrease end time with begin time. The result will return in microseconds.