readd seconds stuff
This commit is contained in:
@@ -10,3 +10,16 @@ fn os_date_t os_local_time_now(void) {
|
||||
result.year = lt->tm_year;
|
||||
return result;
|
||||
}
|
||||
|
||||
fn u64 os_get_microseconds(void) {
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
u64 result = t.tv_sec*million(1) + (t.tv_nsec/thousand(1));
|
||||
return result;
|
||||
}
|
||||
|
||||
fn f64 os_get_milliseconds(void) {
|
||||
u64 micros = os_get_microseconds();
|
||||
f64 result = (f64)micros / 1000.0;
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user