forked from wolfSSL/wolfssl
Simplify Windows Entropy_TimeHiRes
, which just needs a precision timer to differentiate, not specific time.
This commit is contained in:
@@ -988,22 +988,13 @@ static void Entropy_StopThread(void)
|
|||||||
|
|
||||||
/* Get the high resolution time counter.
|
/* Get the high resolution time counter.
|
||||||
*
|
*
|
||||||
* @return 64-bit time that is the nanoseconds of current time.
|
* @return 64-bit timer
|
||||||
*/
|
*/
|
||||||
static WC_INLINE word64 Entropy_TimeHiRes(void)
|
static WC_INLINE word64 Entropy_TimeHiRes(void)
|
||||||
{
|
{
|
||||||
static int init = 0;
|
LARGE_INTEGER count;
|
||||||
static LARGE_INTEGER freq;
|
|
||||||
LARGE_INTEGER count;
|
|
||||||
|
|
||||||
if (!init) {
|
|
||||||
QueryPerformanceFrequency(&freq);
|
|
||||||
init = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryPerformanceCounter(&count);
|
QueryPerformanceCounter(&count);
|
||||||
|
return (word64)(count.QuadPart);
|
||||||
return (word64)(count.QuadPart / (freq.QuadPart / 1000 / 1000));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user