From f52078f5a17dd508c47a79d2312ff4bc8c38070c Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Thu, 16 Mar 2023 11:23:19 +0800 Subject: [PATCH] fix win32 ms time fail `GetSystemTimeAsFileTime` returns 100 nano seconds elapsed time, not 100 micro seconds. Signed-off-by: Jerry Yu --- library/platform_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/platform_util.c b/library/platform_util.c index d8d970837..c784ea414 100644 --- a/library/platform_util.c +++ b/library/platform_util.c @@ -200,7 +200,7 @@ mbedtls_ms_time_t mbedtls_ms_time(void) GetSystemTimeAsFileTime(&ct); current_ms = ((mbedtls_ms_time_t) ct.dwLowDateTime + - ((mbedtls_ms_time_t) (ct.dwHighDateTime) << 32LL))/10; + ((mbedtls_ms_time_t) (ct.dwHighDateTime) << 32LL))/10000; return current_ms; } #else