summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp10
-rw-r--r--platform/windows/os_windows.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 95bfa2ea94..6ac27b7dbf 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1681,10 +1681,16 @@ uint64_t OS_Windows::get_unix_time() const {
return (*(uint64_t*)&ft - *(uint64_t*)&fep) / 10000000;
};
-uint64_t OS_Windows::get_system_time_msec() const {
+uint64_t OS_Windows::get_system_time_secs() const {
SYSTEMTIME st;
GetSystemTime(&st);
- return st.wMilliseconds;
+ FILETIME ft;
+ SystemTimeToFileTime(&st,&ft);
+ uint64_t ret;
+ ret=ft.dwHighDateTime;
+ ret<<=32;
+ ret|=ft.dwLowDateTime;
+ return ret;
}
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 dfa2b40595..69bdcda278 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -231,7 +231,7 @@ public:
virtual Time get_time(bool utc) const;
virtual TimeZoneInfo get_time_zone_info() const;
virtual uint64_t get_unix_time() const;
- virtual uint64_t get_system_time_msec() const;
+ virtual uint64_t get_system_time_secs() const;
virtual bool can_draw() const;
virtual Error set_cwd(const String& p_cwd);