summaryrefslogtreecommitdiffstats
path: root/drivers/unix/os_unix.cpp
diff options
context:
space:
mode:
authorvolzhs <volzhs@gmail.com>2018-12-20 06:18:52 +0900
committervolzhs <volzhs@gmail.com>2018-12-20 18:50:50 +0900
commit84d060c768c10145374d48ebd2b3f00430c73638 (patch)
tree75db8f881850f4c17b07a992e9c2e79442fbecfe /drivers/unix/os_unix.cpp
parent26058376aa180f70e152070b3b69272287a710a8 (diff)
downloadredot-engine-84d060c768c10145374d48ebd2b3f00430c73638.tar.gz
Added OS.get_system_time_msecs()
Diffstat (limited to 'drivers/unix/os_unix.cpp')
-rw-r--r--drivers/unix/os_unix.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 279274734f..12a1263042 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -202,6 +202,12 @@ uint64_t OS_Unix::get_system_time_secs() const {
return uint64_t(tv_now.tv_sec);
}
+uint64_t OS_Unix::get_system_time_msecs() const {
+ struct timeval tv_now;
+ gettimeofday(&tv_now, NULL);
+ return uint64_t(tv_now.tv_sec * 1000 + tv_now.tv_usec / 1000);
+}
+
OS::Date OS_Unix::get_date(bool utc) const {
time_t t = time(NULL);