mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 19:04:12 +08:00
mdbx-test: minor cleanup osal_delay() for Windows.
Change-Id: If9c57cc1eba4c873be5d9176f7f6745c2363a0d6
This commit is contained in:
parent
971f924c44
commit
5d7d45f0e5
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2019 Leonid Yuriev <leo@yuriev.ru>
|
* Copyright 2017-2020 Leonid Yuriev <leo@yuriev.ru>
|
||||||
* and other libmdbx authors: please see AUTHORS file.
|
* and other libmdbx authors: please see AUTHORS file.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@ -424,16 +424,10 @@ void osal_udelay(unsigned us) {
|
|||||||
|
|
||||||
static unsigned threshold_us;
|
static unsigned threshold_us;
|
||||||
if (threshold_us == 0) {
|
if (threshold_us == 0) {
|
||||||
#if 1
|
|
||||||
unsigned timeslice_ms = 1;
|
unsigned timeslice_ms = 1;
|
||||||
while (timeBeginPeriod(timeslice_ms) == TIMERR_NOCANDO)
|
while (timeBeginPeriod(timeslice_ms) == TIMERR_NOCANDO)
|
||||||
++timeslice_ms;
|
++timeslice_ms;
|
||||||
threshold_us = timeslice_ms * 1500u;
|
threshold_us = timeslice_ms * 1500u;
|
||||||
#else
|
|
||||||
ULONGLONG InterruptTimePrecise_100ns;
|
|
||||||
QueryInterruptTimePrecise(&InterruptTimePrecise_100ns);
|
|
||||||
threshold_us = InterruptTimePrecise_100ns / 5;
|
|
||||||
#endif
|
|
||||||
assert(threshold_us > 0);
|
assert(threshold_us > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user