Merge pull request #8 from furlongm/cygwin-support

Add support for cygwin
This commit is contained in:
Ori Livneh 2015-07-29 09:57:11 -07:00
commit 67fb513d10
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'),