Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: interpreting the fractional portion of time.clock() vs time.time()measurements (http://www.velocityreviews.com/forums/t354697-re-interpreting-the-fractional-portion-of-time-clock-vs-time-time-measurements.html)

 Peter Hansen 02-22-2006 12:03 AM

Re: interpreting the fractional portion of time.clock() vs time.time()measurements

john peter wrote:
>
> let's say i'm taking timing measurements in Windows XP
>
> t1 = time.clock()
> ...
> t2 = time.clock()
>
> t3 = t2 - t1 = say, 0.018
> what is the unit of measurement for t3? is it correct to say that t3 =
> 18 milliseconds? microseconds?
>
> what if the timing function used for t1 and t2 was time.time()? is it
> still correct to
> say that t3 = 18 milliseconds? i kinda know that in Windows,
> time.clock() has
> higher resolution than time.time(). all i need is millisecond
> resolution. which
> of these functions would be easier to translate into millisecond units
> of measurement?

Both return seconds. As the docs say (I believe), however, time.clock()
is higher resolution, so you should prefer it on Windows for short
intervals (where short is defined as well under 24 hours).

I imagine you already know how to convert seconds into milliseconds...

-Peter

 All times are GMT. The time now is 04:21 PM.