Skip to content

Commit 4862b57

Browse files
committed
Simplify Windows Entropy_TimeHiRes, which just needs a precision timer to differentiate, not specific time.
1 parent 761a976 commit 4862b57

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

wolfcrypt/src/random.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -988,22 +988,13 @@ static void Entropy_StopThread(void)
988988

989989
/* Get the high resolution time counter.
990990
*
991-
* @return 64-bit time that is the nanoseconds of current time.
991+
* @return 64-bit timer
992992
*/
993993
static WC_INLINE word64 Entropy_TimeHiRes(void)
994994
{
995-
static int init = 0;
996-
static LARGE_INTEGER freq;
997-
LARGE_INTEGER count;
998-
999-
if (!init) {
1000-
QueryPerformanceFrequency(&freq);
1001-
init = 1;
1002-
}
1003-
995+
LARGE_INTEGER count;
1004996
QueryPerformanceCounter(&count);
1005-
1006-
return (word64)(count.QuadPart / (freq.QuadPart / 1000 / 1000));
997+
return (word64)(count.QuadPart);
1007998
}
1008999

10091000
#else

0 commit comments

Comments
 (0)