I'll regularly get $ct equal to .00172234121 and the like.
My question is just how accurate is that number?
The clock is in hardware, so it just is what it is, but how long it takes to execute the microtime command could vary rather a lot on that scale. There may be an interrupt in progress, you may need to wait for some other task to complete...
Hard to say.
If you're trying to find out how long something is taking, make it take a long time, either by doing it a lot or intrinsically slow functions.
On another front, I do this sort of measurement in microcontrollers by using a "ping" on an I/O bit.
clear bit ;Make sure it's low
set bit ;Go high
The timed routine
clear bit ;Go low
On my current platform, the iinstructions are 125nS, and the diagmostic adds 375nS to the routine it's measuring.
This only works though if ints are disabled, or the thing I'm timing is inside an ISR.
You don't have a way in PHP to turn off ints (THANK GOD) so you'll always have some jitter in the measurement of anything like this.
This is a core problem though, with the question of "what time is it", because it depends on how long it takes you to ask/answer the question.
--
www.SpamWhack.com A pre-emptive strike against spam
A tornado is a lady whose skirts you do NOT want to look up!
Where's dave?
http://www.findu.com/cgi-bin/find.cgi?kc6ete-9