diff --git a/monotonic.py b/monotonic.py index afff9b4..896f09b 100644 --- a/monotonic.py +++ b/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'),