Commit 36e91ba9 authored by Guido van Rossum's avatar Guido van Rossum

Prefer clock() over times() for timer function, except on the Mac,

where we use GetTicks() -- its clock() is a crock, with only 1 second
accuracy, I believe.
parent 3e7ea26d
......@@ -149,14 +149,17 @@ class Profile:
}
if not timer:
if hasattr(os, 'times'):
self.timer = os.times
self.dispatcher = self.trace_dispatch
elif os.name == 'mac':
if os.name == 'mac':
import MacOS
self.timer = MacOS.GetTicks
self.dispatcher = self.trace_dispatch_mac
self.get_time = self.get_time_mac
elif hasattr(time, 'clock'):
self.timer = time.clock
self.dispatcher = self.trace_dispatch_i
elif hasattr(os, 'times'):
self.timer = os.times
self.dispatcher = self.trace_dispatch
else:
self.timer = time.time
self.dispatcher = self.trace_dispatch_i
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment