comparison win32.py @ 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 06356af50bf9
children c62c9bfd614a
comparison
equal deleted inserted replaced
84:953a5baa406d 85:741ae3391b61
12 12
13 from ctypes import * 13 from ctypes import *
14 from ctypes.wintypes import * 14 from ctypes.wintypes import *
15 from msvcrt import getch as pause 15 from msvcrt import getch as pause
16 from subprocess import Popen 16 from subprocess import Popen
17 from __main__ import clock 17
18 try:
19 from testcases import clock
20 except ImportError:
21 from time import clock
18 22
19 # Defaults that may be overwritten by values from _subprocess 23 # Defaults that may be overwritten by values from _subprocess
20 INFINITE = -1 24 INFINITE = -1
21 STD_INPUT_HANDLE = -10 25 STD_INPUT_HANDLE = -10
22 WAIT_OBJECT_0 = 0 26 WAIT_OBJECT_0 = 0
41 __getnewargs__ = lambda self: tuple(self) 45 __getnewargs__ = lambda self: tuple(self)
42 kernel, user = (property(itemgetter(i)) for i in (0, 1)) 46 kernel, user = (property(itemgetter(i)) for i in (0, 1))
43 else: 47 else:
44 ProcessTimes = namedtuple('ProcessTimes', 'kernel user') 48 ProcessTimes = namedtuple('ProcessTimes', 'kernel user')
45 49
46 __all__ = 'call', 'kill', 'terminate', 'pause' 50 __all__ = 'call', 'kill', 'terminate', 'pause', 'clock'
47 51
48 52
49 # Automatically convert _subprocess handle objects into low-level HANDLEs 53 # Automatically convert _subprocess handle objects into low-level HANDLEs
50 # and replicate their functionality for our own use 54 # and replicate their functionality for our own use
51 try: 55 try: