diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-03-29 14:21:30 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-03-29 14:21:30 +0400 |
commit | cd50649255074f7d76400127ed7613d78c08488b (patch) | |
tree | 0a024d44927d7dad724cb093591ad8fc4bf32d80 /winsup/cygwin/hires.h | |
parent | 700c641dfa72b292a231810ab35d93849f4c8fe1 (diff) |
* autoload.cc (winmm): Remove time functions. Don't treat
unloadable wave functions as fatal.
* hires.h (hires_ms::timeGetTime_ns): New private method.
(hires_ms::dmsecs): Call timeGetTime_ns here.
* ntdll.h (struct _KSYSTEM_TIME): Define.
(KUSER_SHARED_DATA): Redefine to allow access to InterruptTime.
(SharedUserData): Define here.
(NtQueryTimerResolution): Declare.
(NtSetTimerResolution): Declare.
* path.cc (SharedUserData): Move to ntdll.h.
* times.cc (hires_ms::timeGetTime_ns): New private method.
Use throughout instead of timeGetTime. Document entire functionality
of timeGetTime in case we need it.
(hires_ms::resolution): Try a call to NtQueryTimerResolution
to fetch current period. Fall back to heuristic if that fails.
Cast to DWORD in assignments to minperiod.
(clock_setres): Align period to possible values per a call to
NtQueryTimerResolution. Explain why. Replace calls to timeBeginPeriod
and timeEndPeriod with underlying call to NtSetTimerResolution. Use
status code from NtSetTimerResolution to compute errno.
Convert period to ULONGLONG and store 100ns value to simplify code.
Diffstat (limited to 'winsup/cygwin/hires.h')
-rw-r--r-- | winsup/cygwin/hires.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/hires.h b/winsup/cygwin/hires.h index 5f87453d6..42151197f 100644 --- a/winsup/cygwin/hires.h +++ b/winsup/cygwin/hires.h @@ -43,12 +43,13 @@ class hires_ns : public hires_base class hires_ms : public hires_base { LONGLONG initime_ns; + LONGLONG timeGetTime_ns (); void prime (); public: LONGLONG nsecs (); LONGLONG usecs () {return nsecs () / 10LL;} LONGLONG msecs () {return nsecs () / 10000LL;} - UINT dmsecs () { return timeGetTime (); } + UINT dmsecs () { return timeGetTime_ns () / 10000LL; } UINT resolution (); LONGLONG uptime () {return (nsecs () - initime_ns) / 10000LL;} }; |