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
+11
View File
@@ -46,9 +46,20 @@ diff :: proc(start, end: Time) -> Duration {
return Duration(d);
}
since :: proc(start: Time) -> Duration {
return diff(start, now());
}
duration_nanoseconds :: proc(d: Duration) -> i64 {
return i64(d);
}
duration_microseconds :: proc(d: Duration) -> f64 {
return duration_seconds(d) * 1e6;
}
duration_milliseconds :: proc(d: Duration) -> f64 {
return duration_seconds(d) * 1e3;
}
duration_seconds :: proc(d: Duration) -> f64 {
sec := d / Second;
nsec := d % Second;