Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1
12#ifndef BJ_TIME_H
13#define BJ_TIME_H
14
15#include <banjo/api.h>
16#include <banjo/error.h>
17
27uint64_t bj_get_time(
28 void
29);
30
43 int milliseconds
44);
45
57 void
58);
59
72 void
73);
74
86 void
87);
88
96typedef struct bj_stopwatch
97{
98 uint64_t start_counter;
99 uint64_t last_tick;
101
113 bj_stopwatch* p_stopwatch
114);
115
128 bj_stopwatch* p_stopwatch
129);
130
144 const bj_stopwatch* p_stopwatch
145);
146
160 const bj_stopwatch* p_stopwatch
161);
162
176 bj_stopwatch* p_stopwatch
177);
178
179#endif
General-purpose definitions for Banjo API.
Recoverable error handling.
uint64_t last_tick
Time of last step/checkpoint.
Definition time.h:99
uint64_t start_counter
Time when stopwatch was last reset.
Definition time.h:98
double bj_step_delay_stopwatch(bj_stopwatch *p_stopwatch)
Steps the stopwatch and returns the delay since the previous step.
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_time_frequency(void)
Returns the frequency of the high-resolution counter.
uint64_t bj_get_time(void)
Get the current system time in seconds since the Unix epoch.
double bj_stopwatch_elapsed(const bj_stopwatch *p_stopwatch)
Returns the elapsed time in seconds since the stopwatch was reset.
double bj_run_time(void)
Gets the current time in seconds since Banjo initialization.
uint64_t bj_time_counter(void)
Returns the current high-resolution time counter.
void bj_step_stopwatch(bj_stopwatch *p_stopwatch)
Records a step/checkpoint in time.
void bj_reset_stopwatch(bj_stopwatch *p_stopwatch)
Resets the stopwatch to the current time.
Structure representing a simple stopwatch.
Definition time.h:97