Merge pull request #8 from furlongm/cygwin-support
Add support for cygwin
This commit is contained in:
commit
67fb513d10
10
monotonic.py
10
monotonic.py
@ -96,6 +96,16 @@ except AttributeError:
|
||||
"""Monotonic clock, cannot go backward."""
|
||||
return GetTickCount64() / 1000.0
|
||||
|
||||
elif sys.platform.startswith('cygwin'):
|
||||
# Cygwin
|
||||
kernel32 = ctypes.cdll.LoadLibrary('kernel32.dll')
|
||||
GetTickCount64 = kernel32.GetTickCount64
|
||||
GetTickCount64.restype = ctypes.c_ulonglong
|
||||
|
||||
def monotonic():
|
||||
"""Monotonic clock, cannot go backward."""
|
||||
return GetTickCount64() / 1000.0
|
||||
|
||||
else:
|
||||
try:
|
||||
clock_gettime = ctypes.CDLL(ctypes.util.find_library('c'),
|
||||
|
Loading…
Reference in New Issue
Block a user