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
97{
98 uint64_t start_counter;
99 uint64_t last_tick;
100};
101
113 struct bj_stopwatch* stopwatch
114);
115
128 struct bj_stopwatch* stopwatch
129);
130
144 const struct bj_stopwatch* stopwatch
145);
146
160 const struct bj_stopwatch* stopwatch
161);
162
176 struct bj_stopwatch* 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
void bj_sleep(int milliseconds)
Suspends the current thread for a specified duration.
void bj_reset_stopwatch(struct bj_stopwatch *stopwatch)
Resets the stopwatch to the current time.
double bj_step_delay_stopwatch(struct bj_stopwatch *stopwatch)
Steps the stopwatch and returns the delay since the previous step.
uint64_t bj_time_frequency(void)
Returns the frequency of the high-resolution counter.
double bj_stopwatch_delay(const struct bj_stopwatch *stopwatch)
Returns the time in seconds since the last step.
uint64_t bj_get_time(void)
Get the current system time in seconds since the Unix epoch.
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(struct bj_stopwatch *stopwatch)
Records a step/checkpoint in time.
double bj_stopwatch_elapsed(const struct bj_stopwatch *stopwatch)
Returns the elapsed time in seconds since the stopwatch was reset.
Structure representing a simple stopwatch.
Definition time.h:97