General-purpose definitions for Banjo API.
Recoverable error handling.
uint64_t last_tick
Time of last step/checkpoint.
uint64_t start_counter
Time when stopwatch was last reset.
double bj_step_stopwatch(struct bj_stopwatch *stopwatch)
Record a step and return the seconds since the previous step.
void bj_sleep(int milliseconds)
void bj_reset_stopwatch(struct bj_stopwatch *stopwatch)
Resets the stopwatch to the current time.
double bj_stopwatch_split(const struct bj_stopwatch *stopwatch)
Return the seconds since the last step, without recording one.
double bj_step_delay_stopwatch(struct bj_stopwatch *stopwatch)
uint64_t bj_time_frequency(void)
Returns the frequency of the high-resolution counter.
double bj_stopwatch_delay(const struct bj_stopwatch *stopwatch)
uint64_t bj_get_time(void)
Get the current system time in seconds since the Unix epoch.
void bj_sleep_ms(int milliseconds)
Suspend the current thread for at least the given number of milliseconds.
double bj_run_time(void)
Gets the current time in seconds since Banjo initialisation.
uint64_t bj_time_counter(void)
Returns the current high-resolution time counter.
double bj_stopwatch_total(const struct bj_stopwatch *stopwatch)
Return the seconds elapsed since the stopwatch was last reset.
double bj_stopwatch_elapsed(const struct bj_stopwatch *stopwatch)
Structure representing a simple stopwatch.