General-purpose definitions for Banjo API.
Recoverable error handling.
uint64_t last_tick
Time of last step/checkpoint.
Definition time.h:85
uint64_t start_counter
Time when stopwatch was last reset.
Definition time.h:84
void bj_stopwatch_reset(bj_stopwatch *p_stopwatch)
Resets the stopwatch to the current time.
double bj_stopwatch_delay(const bj_stopwatch *p_stopwatch)
Returns the time in seconds since the last step.
void bj_sleep(int milliseconds)
Suspends the current thread for a specified duration.
uint64_t bj_get_time_counter(void)
Returns the current high-resolution time counter.
void bj_stopwatch_step(bj_stopwatch *p_stopwatch)
Records a step/checkpoint in time.
double bj_stopwatch_elapsed(const bj_stopwatch *p_stopwatch)
Returns the elapsed time in seconds since the stopwatch was reset.
double bj_get_time(void)
Gets the current time in seconds since Banjo initialization.
uint64_t bj_get_time_frequency(void)
Returns the frequency of the high-resolution counter.
double bj_stopwatch_step_delay(bj_stopwatch *p_stopwatch)
Steps the stopwatch and returns the delay since the previous step.
Structure representing a simple stopwatch.
Definition time.h:83