diff options
| author | Barinzaya <barinzaya@gmail.com> | 2025-04-24 09:17:48 -0400 |
|---|---|---|
| committer | Barinzaya <barinzaya@gmail.com> | 2025-04-24 09:20:31 -0400 |
| commit | 6400693197bec1b16c5ec6bb9012fd87be00ee2b (patch) | |
| tree | 6a61e6fc263392596cd9d8d367b2f70ee26fac7f | |
| parent | c7f9d2b1b78b5bad6c677bf649abafcc5c5270c1 (diff) | |
Added `tick_add` proc to `core:time`.
| -rw-r--r-- | core/time/perf.odin | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/time/perf.odin b/core/time/perf.odin index 784d7acd6..265a20edf 100644 --- a/core/time/perf.odin +++ b/core/time/perf.odin @@ -18,6 +18,13 @@ tick_now :: proc "contextless" () -> Tick { } /* +Add duration to a tick. +*/ +tick_add :: proc "contextless" (t: Tick, d: Duration) -> Tick { + return Tick{t._nsec + i64(d)} +} + +/* Obtain the difference between ticks. */ tick_diff :: proc "contextless" (start, end: Tick) -> Duration { |