We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Entropy_TimeHiRes
1 parent 761a976 commit 4862b57Copy full SHA for 4862b57
1 file changed
wolfcrypt/src/random.c
@@ -988,22 +988,13 @@ static void Entropy_StopThread(void)
988
989
/* Get the high resolution time counter.
990
*
991
- * @return 64-bit time that is the nanoseconds of current time.
+ * @return 64-bit timer
992
*/
993
static WC_INLINE word64 Entropy_TimeHiRes(void)
994
{
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
+ LARGE_INTEGER count;
1004
QueryPerformanceCounter(&count);
1005
1006
- return (word64)(count.QuadPart / (freq.QuadPart / 1000 / 1000));
+ return (word64)(count.QuadPart);
1007
}
1008
1009
#else
0 commit comments