Added OS.get_system_time_msecs()
This commit is contained in:
@ -2142,8 +2142,13 @@ uint64_t OS_Windows::get_unix_time() const {
|
||||
|
||||
uint64_t OS_Windows::get_system_time_secs() const {
|
||||
|
||||
const uint64_t WINDOWS_TICK = 10000000;
|
||||
const uint64_t SEC_TO_UNIX_EPOCH = 11644473600LL;
|
||||
return get_system_time_msecs() / 1000;
|
||||
}
|
||||
|
||||
uint64_t OS_Windows::get_system_time_msecs() const {
|
||||
|
||||
const uint64_t WINDOWS_TICK = 10000;
|
||||
const uint64_t MSEC_TO_UNIX_EPOCH = 11644473600000LL;
|
||||
|
||||
SYSTEMTIME st;
|
||||
GetSystemTime(&st);
|
||||
@ -2154,7 +2159,7 @@ uint64_t OS_Windows::get_system_time_secs() const {
|
||||
ret <<= 32;
|
||||
ret |= ft.dwLowDateTime;
|
||||
|
||||
return (uint64_t)(ret / WINDOWS_TICK - SEC_TO_UNIX_EPOCH);
|
||||
return (uint64_t)(ret / WINDOWS_TICK - MSEC_TO_UNIX_EPOCH);
|
||||
}
|
||||
|
||||
void OS_Windows::delay_usec(uint32_t p_usec) const {
|
||||
|
||||
Reference in New Issue
Block a user