formatting time as milliseconds in logging module

Josiah Carlson jcarlson at
Tue Oct 19 20:24:15 CEST 2004

> >In Windows: time.clock() will get you the number of seconds since you
> >last called it, down to the microsecond (trim as you see fit).
>  ^^^^ first, it seems (certainly not a delta since the last time.clock() call)

Oops, word slip.  My bad, I meant first.

> Don't know why the first value is not a pure 0.0 though.

The C source tells us that in Windows, the performance counter call to
guarantee that it has been started occurs before the counter call to
actually get the number of seconds since the first call.

> Maybe not even all windows. E.g., for NT that is one scheuling time slice,
> but oher variants might have other granularity, IWT.

Good point, though I think that 9x variants also had .01 second

> Unless your process is running with hard real time priority, you have to throw in
> os multitasking and interrupt processing latency as well (try using the mouse to drag
> a complex GUI window of another app around continuously while your test runs ;-).

Now you are talking about external system loads and how they effect
timings.  That wasn't the question.

 - Josiah

More information about the Python-list mailing list