summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/os_unix.cpp16
-rw-r--r--drivers/unix/os_unix.h4
2 files changed, 4 insertions, 16 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 083cd64116..9a5fc6d1a4 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -163,21 +163,11 @@ String OS_Unix::get_name() const {
return "Unix";
}
-uint64_t OS_Unix::get_unix_time() const {
- return time(nullptr);
-};
-
-uint64_t OS_Unix::get_system_time_secs() const {
- struct timeval tv_now;
- gettimeofday(&tv_now, nullptr);
- return uint64_t(tv_now.tv_sec);
-}
-
-uint64_t OS_Unix::get_system_time_msecs() const {
+double OS_Unix::get_unix_time() const {
struct timeval tv_now;
gettimeofday(&tv_now, nullptr);
- return uint64_t(tv_now.tv_sec) * 1000 + uint64_t(tv_now.tv_usec) / 1000;
-}
+ return (double)tv_now.tv_sec + double(tv_now.tv_usec) / 1000000;
+};
OS::Date OS_Unix::get_date(bool utc) const {
time_t t = time(nullptr);
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 7d235803dc..2982e0c55c 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -77,9 +77,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_secs() const;
- virtual uint64_t get_system_time_msecs() const;
+ virtual double get_unix_time() const;
virtual void delay_usec(uint32_t p_usec) const;
virtual uint64_t get_ticks_usec() const;