aboutsummaryrefslogtreecommitdiff
path: root/include/BH/Timer.h
diff options
context:
space:
mode:
authorMikhail Romanko <me@blankhex.com>2025-09-21 22:07:54 +0300
committerMikhail Romanko <me@blankhex.com>2025-09-21 22:07:54 +0300
commitb1870bd709cb1e1b8353df1c115529bbb324716a (patch)
tree0b06c44d8de17ad438013d7450a3ac3ee17c8d61 /include/BH/Timer.h
parent9bd200702311fdf3794e53c56c212d9ac31728ca (diff)
downloadbhlib-b1870bd709cb1e1b8353df1c115529bbb324716a.tar.gz
Add timers for measuring elapsed time
Diffstat (limited to 'include/BH/Timer.h')
-rw-r--r--include/BH/Timer.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/BH/Timer.h b/include/BH/Timer.h
new file mode 100644
index 0000000..51ab0de
--- /dev/null
+++ b/include/BH/Timer.h
@@ -0,0 +1,32 @@
+#ifndef BH_TIMER_H
+#define BH_TIMER_H
+
+
+#include "Common.h"
+
+
+typedef struct BH_Timer BH_Timer;
+
+
+BH_Timer *BH_TimerNew(void);
+
+
+void BH_TimerFree(BH_Timer *timer);
+
+
+int BH_TimerIsMonotonic(BH_Timer *timer);
+
+
+void BH_TimerStart(BH_Timer *timer);
+
+
+int64_t BH_TimerRestart(BH_Timer *timer);
+
+
+int64_t BH_TimerMilliseconds(BH_Timer *timer);
+
+
+int64_t BH_TimerNanoseconds(BH_Timer *timer);
+
+
+#endif /* BH_TIMER_H */