diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2021-10-29 19:01:33 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-10-29 19:19:40 +0300 |
commit | e8bfe362814ea5e6837cb94656fbc54a743ca940 (patch) | |
tree | 2837fda75c7e669752e9c761a1ffd08b88742559 /winsup/cygwin/clock.cc | |
parent | e36811afb4d86dc70aa3c8c06dafbc3f9782f456 (diff) |
Cygwin: drop support for systems not supporting QueryUnbiasedInterruptTime
i. e., Vista/2008
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/clock.cc')
-rw-r--r-- | winsup/cygwin/clock.cc | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/winsup/cygwin/clock.cc b/winsup/cygwin/clock.cc index 9c0b787ba..e010ed488 100644 --- a/winsup/cygwin/clock.cc +++ b/winsup/cygwin/clock.cc @@ -190,26 +190,13 @@ clk_monotonic_t::now (clockid_t clockid, struct timespec *ts) int clk_monotonic_coarse_t::now (clockid_t clockid, struct timespec *ts) { - if (wincap.has_unbiased_interrupt_time ()) - { - /* Suspend time not taken into account, as on Linux */ - ULONGLONG now; - - QueryUnbiasedInterruptTime (&now); - ts->tv_sec = now / NS100PERSEC; - now %= NS100PERSEC; - ts->tv_nsec = now * (NSPERSEC/NS100PERSEC); - } - else - { - /* Vista-only: GetTickCount64 is biased but it's coarse and monotonic. */ - ULONGLONG now; + /* Suspend time not taken into account, as on Linux */ + ULONGLONG now; - now = GetTickCount64 (); /* Returns ms since boot */ - ts->tv_sec = now / MSPERSEC; - now %= MSPERSEC; - ts->tv_nsec = now * (NSPERSEC/MSPERSEC); - } + QueryUnbiasedInterruptTime (&now); + ts->tv_sec = now / NS100PERSEC; + now %= NS100PERSEC; + ts->tv_nsec = now * (NSPERSEC/NS100PERSEC); return 0; } |