This commit is contained in:
Tenari
2026-07-02 08:59:18 -05:00
parent 87c180bda9
commit 71552a57de
5 changed files with 64 additions and 14 deletions
+15
View File
@@ -353,3 +353,18 @@ bool osThreadJoin(Thread handle, u64 endt_us) {
}
return (wait_result == WAIT_OBJECT_0);
}
fn HumanTime osHumanTimeFromMicroseconds(u64 micros) {
HumanTime result = {0};
time_t secs = (time_t)(micros / MICROSECONDS_PER_SECOND);
struct tm t;
localtime_s(&t, &secs);
result.year = 1900 + t.tm_year;
result.month = t.tm_mon + 1;
result.month_i = t.tm_mon;
result.date = t.tm_mday
result.hour = t.tm_hour;
result.min = t.tm_min;
result.sec = t.tm_sec;
return result;
}