At http://bzr.arbash-meinel.com/branches/bzr/jam-integration
------------------------------------------------------------
revno: 3697
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: jam-integration
timestamp: Tue 2008-09-09 10:09:12 -0500
message:
Use the right timing function on win32
=== modified file 'profile_imports.py'
--- a/profile_imports.py 2006-10-11 00:23:23 +0000
+++ b/profile_imports.py 2008-09-09 15:09:12 +0000
@@ -26,6 +26,9 @@
_total_stack = {}
_info = {}
_cur_id = 0
+_timer = time.time
+if sys.platform == 'win32':
+ _timer = time.clock
def stack_add(name, frame_name, frame_lineno, scope_name=None):
@@ -131,12 +134,12 @@
this = stack_add(extra + name, frame_name, frame_lineno, scope_name)
- tstart = time.time()
+ tstart = _timer()
try:
# Do the import
mod = _real_import(name, globals, locals, fromlist)
finally:
- tload = time.time()-tstart
+ tload = _timer()-tstart
stack_finish(this, tload)
return mod
@@ -160,12 +163,12 @@
frame_lineno = frame.f_lineno
this = stack_add(extra+repr(args[0]), frame_name, frame_lineno)
- tstart = time.time()
+ tstart = _timer()
try:
# Measure the compile time
comp = _real_compile(*args, **kwargs)
finally:
- tcompile = time.time() - tstart
+ tcompile = _timer() - tstart
stack_finish(this, tcompile)
return comp
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits