mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
support win32 port for get_tick()
This commit is contained in:
parent
83559294b8
commit
8055b9de00
@ -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
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user