diff options
author | Maximillian <maximillian.pol@gmail.com> | 2015-08-06 10:29:33 -0700 |
---|---|---|
committer | Maximillian <maximillian.pol@gmail.com> | 2015-08-06 10:29:33 -0700 |
commit | 6f9a084ac8a820450632f17384161c6a24da86d3 (patch) | |
tree | d4dbca6eb52f61d486dec7398db2a97945c5a8d4 /drivers/unix/os_unix.cpp | |
parent | 9d185ccc30ad5fe7eb716390ca2e7f5c06574ce0 (diff) |
Add OS.get_system_time_msec
Diffstat (limited to 'drivers/unix/os_unix.cpp')
-rw-r--r-- | drivers/unix/os_unix.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index f6d9e0fb4e..1afd0be61d 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -223,6 +223,13 @@ uint64_t OS_Unix::get_unix_time() const { return time(NULL); }; +uint64_t OS_Unix::get_system_time_msec() const { + struct timeval tv_now; + gettimeofday(&tv_now, null); + uint64_t msec = tv_now.tv_.sec / 1000; + return msec; +} + OS::Date OS_Unix::get_date(bool utc) const { |