Wraparound problems with time.clock() on Linux
Fernando Perez
fperez528 at yahoo.com
Thu Apr 10 12:51:26 EDT 2003
Carsten Gaebler wrote:
>> Anyone know of a reliable way to time long-running codes?
>
> Without having tested it for more than 72 minutes, I'd try
> resource.getrusage().
Thanks for the suggestion, it worked wondefully. I just ran some tests with
a code which took a few hours on a 2.4 Ghz P-4, and the results are
perfect. As an added bounus, I get discriminated user/system timing info,
which is useful to detect bottlenecks in my code. This code should be cpu
bound, so if there's any amount of significant system time I know I need to
pay attention.
For reference, in case somebody finds it useful, I'm attaching the new Timer
module which uses resource.
Cheers,
f.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Timer.py
Type: text/x-java
Size: 4212 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030410/90fb24eb/attachment.java>
More information about the Python-list
mailing list