Add support for cygwin

This commit is contained in:
Marcus Furlong 2015-07-23 13:53:19 +10:00
parent 7a90ceeb2b
commit cc9170147c
1 changed files with 10 additions and 0 deletions

View File

@ -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'),