From cc945cad053cd36d67ee5daf50a71e212ce2cfe3 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Tue, 8 Jul 2025 08:39:27 -0700 Subject: Fixes, add time_add --- timer/include/timer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'timer/include/timer.h') diff --git a/timer/include/timer.h b/timer/include/timer.h index 94781d6..6dc87d9 100644 --- a/timer/include/timer.h +++ b/timer/include/timer.h @@ -20,7 +20,7 @@ typedef struct timespec time_point; typedef uint64_t time_delta; /// A high resolution timer. -typedef struct { +typedef struct Timer { time_point start_time; // The instant the timer was last started. time_point last_tick; // The instant the timer was last ticked. time_delta running_time; // Time elapsed since the timer was last started. @@ -53,6 +53,9 @@ time_delta sec_to_time_delta(double seconds); /// Convert the time point to nanoseconds. uint64_t time_point_to_ns(time_point); +/// Add a time delta to a timestamp. +time_point time_add(time_point, time_delta); + /// Put the caller thread to sleep for the given amount of time. void time_sleep(time_delta dt); -- cgit v1.2.3