From a120c66f98586138fc61fa6f243cb071d60111bc Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 10 Jan 2016 18:24:55 -0300 Subject: -Removed OS.get_system_time_msec(), this is undoable on Windows and also unusable from GDscript due to precision. -Added, instead an OS.get_system_time_secs(), which is 32 bits friendly, fixes #3143 --- drivers/unix/os_unix.cpp | 5 ++--- drivers/unix/os_unix.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index bdf7daf799..405d84f0f1 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -233,13 +233,12 @@ uint64_t OS_Unix::get_unix_time() const { return time(NULL); }; -uint64_t OS_Unix::get_system_time_msec() const { +uint64_t OS_Unix::get_system_time_secs() const { struct timeval tv_now; gettimeofday(&tv_now, NULL); //localtime(&tv_now.tv_usec); //localtime((const long *)&tv_now.tv_usec); - uint64_t msec = uint64_t(tv_now.tv_sec)*1000+tv_now.tv_usec/1000; - return msec; + return uint64_t(tv_now.tv_sec); } diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index 1baed9e869..a889bba0ff 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -95,7 +95,7 @@ public: 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 void delay_usec(uint32_t p_usec) const; virtual uint64_t get_ticks_usec() const; -- cgit v1.2.3