Add time.Tick for performance related timings

This commit is contained in:
gingerBill
2021-01-09 01:08:16 +00:00
parent fba4bfb2d5
commit 9e8c46b8de
4 changed files with 78 additions and 0 deletions
+7
View File
@@ -83,3 +83,10 @@ nanosleep :: proc(nanoseconds: i64) -> int {
remaining: TimeSpec; // NOTE(tetra): Do we need to initialize this?
return int(_unix_nanosleep(&requested, &remaining));
}
_tick_now :: proc() -> Tick {
t := clock_gettime(CLOCK_MONOTONIC_RAW);
_nsec := t.tv_sec*1e9 + t.tv_nsec;
return Tick{_nsec = _nsec};
}