aboutsummaryrefslogtreecommitdiff
path: root/timer/include/timer.h
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-07-08 08:39:27 -0700
committer3gg <3gg@shellblade.net>2025-07-08 08:39:27 -0700
commitcc945cad053cd36d67ee5daf50a71e212ce2cfe3 (patch)
tree1ffa2aa11d43528bfe439be0113777fd67d0317d /timer/include/timer.h
parentf99204184c8b96f499f6e7efbffb8b6b4ea8c93f (diff)
Fixes, add time_addHEADmain
Diffstat (limited to 'timer/include/timer.h')
-rw-r--r--timer/include/timer.h5
1 files changed, 4 insertions, 1 deletions
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;
20typedef uint64_t time_delta; 20typedef uint64_t time_delta;
21 21
22/// A high resolution timer. 22/// A high resolution timer.
23typedef struct { 23typedef struct Timer {
24 time_point start_time; // The instant the timer was last started. 24 time_point start_time; // The instant the timer was last started.
25 time_point last_tick; // The instant the timer was last ticked. 25 time_point last_tick; // The instant the timer was last ticked.
26 time_delta running_time; // Time elapsed since the timer was last started. 26 time_delta running_time; // Time elapsed since the timer was last started.
@@ -53,6 +53,9 @@ time_delta sec_to_time_delta(double seconds);
53/// Convert the time point to nanoseconds. 53/// Convert the time point to nanoseconds.
54uint64_t time_point_to_ns(time_point); 54uint64_t time_point_to_ns(time_point);
55 55
56/// Add a time delta to a timestamp.
57time_point time_add(time_point, time_delta);
58
56/// Put the caller thread to sleep for the given amount of time. 59/// Put the caller thread to sleep for the given amount of time.
57void time_sleep(time_delta dt); 60void time_sleep(time_delta dt);
58 61