Add timers for measuring elapsed time

This commit is contained in:
2025-09-21 22:07:54 +03:00
parent 9bd2007023
commit b1870bd709
11 changed files with 565 additions and 3 deletions

32
include/BH/Timer.h Normal file
View File

@@ -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 */