Added OS.get_system_time_msecs()

This commit is contained in:
volzhs
2018-12-20 06:18:52 +09:00
parent 26058376aa
commit 84d060c768
9 changed files with 33 additions and 3 deletions

View File

@ -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);