summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/os_windows.cpp11
-rw-r--r--platform/windows/os_windows.h1
2 files changed, 9 insertions, 3 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index e1cbbcc66b..dff87b2c5d 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -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 {
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index d09ade4daa..e12e465dd3 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -254,6 +254,7 @@ public:
virtual TimeZoneInfo get_time_zone_info() const;
virtual uint64_t get_unix_time() const;
virtual uint64_t get_system_time_secs() const;
+ virtual uint64_t get_system_time_msecs() const;
virtual bool can_draw() const;
virtual Error set_cwd(const String &p_cwd);