diff upreckon-vcs @ 85:741ae3391b61

Moved clock/time detection into platform-specific modules and testcases
author Oleg Oshmyan <chortos@inbox.lv>
date Thu, 24 Feb 2011 23:59:48 +0000
parents 37c4ad87583c
children 179bad0d29f4
line wrap: on
line diff
--- a/upreckon-vcs	Thu Feb 24 00:29:32 2011 +0000
+++ b/upreckon-vcs	Thu Feb 24 23:59:48 2011 +0000
@@ -64,25 +64,6 @@
 if options.legacy:
 	compat.pseudobuiltins += 'xrange',
 
-if options.autotime:
-	# This is really a dirty hack that assumes that sleep() does not spend
-	# the CPU time of the current process and that if clock() measures
-	# wall-clock time, then it is more precise than time() is. Both these
-	# assumptions are true on all platforms I have tested this on so far,
-	# but I am not aware of any guarantee that they will both be true
-	# on every other platform.
-	c = time.clock()
-	time.sleep(1)
-	c = time.clock() - c
-	if int(c + .5) == 1:
-		clock = time.clock
-	else:
-		clock = time.time
-elif sys.platform == 'win32':
-	clock = time.clock
-else:
-	clock = time.time
-
 try:
 	import testcases
 except ImportError: