Banjo API 0.0.1
Multi-purpose C99 API
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1
12#pragma once
13
14#include <banjo/api.h>
15#include <banjo/error.h>
16
29 int milliseconds
30);
31
43 void
44);
45
58 void
59);
60
72 void
73);
74
82typedef struct bj_stopwatch
83{
84 uint64_t start_counter;
85 uint64_t last_tick;
87
99 bj_stopwatch* p_stopwatch
100);
101
114 bj_stopwatch* p_stopwatch
115);
116
130 const bj_stopwatch* p_stopwatch
131);
132
146 const bj_stopwatch* p_stopwatch
147);
148
162 bj_stopwatch* p_stopwatch
163);
164
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