php microtime explanation php microtime explanation php php

php microtime explanation


It still takes extra overhead for function calls and variable assignment, etc. It will be AT LEAST the length of time you sleep, probably a few milliseconds more.


This might be wrong, but I remember a long time ago someone telling me that time on computers is very hard to measure.

Considering that calling the functions sleep() and microtime() all take some time it will always be out. There is an overhead in doing anything which won't be part of the timing process.