support win32 port for get_tick()

This commit is contained in:
Lyon 2024-01-04 20:20:26 +08:00
parent 83559294b8
commit 8055b9de00
2 changed files with 10 additions and 1 deletions

View File

@ -157,6 +157,15 @@ PIKA_WEAK int64_t pika_platform_get_tick(void) {
#elif PIKA_RTTHREAD_ENABLE
uint32_t tick = rt_tick_get() * 1000;
return (uint32_t)((tick + RT_TICK_PER_SECOND - 1) / RT_TICK_PER_SECOND);
#elif defined(_WIN32) && !defined(CROSS_BUILD)
FILETIME ft;
ULARGE_INTEGER ull;
GetSystemTimeAsFileTime(&ft);
ull.LowPart = ft.dwLowDateTime;
ull.HighPart = ft.dwHighDateTime;
ull.QuadPart -= 116444736000000000;
ull.QuadPart /= 10000;
return ull.QuadPart;
#else
return -1;
#endif

View File

@ -2,4 +2,4 @@
#define PIKA_VERSION_MINOR 13
#define PIKA_VERSION_MICRO 1
#define PIKA_EDIT_TIME "2024/01/04 20:07:43"
#define PIKA_EDIT_TIME "2024/01/04 20:20:09"