diff options
| author | stijn | 2016-11-01 10:25:13 +0100 |
|---|---|---|
| committer | stijn | 2016-11-03 10:31:58 +0100 |
| commit | 3272afe57f3303ee178c6d0a3d08614a2a154e4e (patch) | |
| tree | b97589f69878e077f1b297448c56627c747869fe /windows/windows_mphal.c | |
| parent | 0b9ed550267ca0efba094d14c250f268d744818d (diff) | |
windows: Implement mp_hal_ticks_cpu in terms of QueryPerformanceCounter
Diffstat (limited to 'windows/windows_mphal.c')
| -rw-r--r-- | windows/windows_mphal.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/windows/windows_mphal.c b/windows/windows_mphal.c index 1b2ed314a..3ad693905 100644 --- a/windows/windows_mphal.c +++ b/windows/windows_mphal.c @@ -217,3 +217,13 @@ mp_uint_t mp_hal_ticks_us(void) { gettimeofday(&tv, NULL); return tv.tv_sec * 1000000 + tv.tv_usec; } + +mp_uint_t mp_hal_ticks_cpu(void) { + LARGE_INTEGER value; + QueryPerformanceCounter(&value); +#ifdef _WIN64 + return value.QuadPart; +#else + return value.LowPart; +#endif +} |
