Banjo API 0.0.1
Multi-purpose C99 API
|
Abstraction to usual system calls related to time. More...
Functions | |
void | bj_sleep (int milliseconds) |
Suspends the current thread for a specified duration. | |
double | bj_get_time (void) |
Gets the current time in seconds. | |
uint64_t | bj_get_time_counter (void) |
Gets the current raw high-resolution time counter. | |
uint64_t | bj_get_time_frequency (void) |
Gets the frequency of the high-resolution time counter. | |
double bj_get_time | ( | void | ) |
Returns the elapsed time in seconds since Banjo is initialized with bj_begin.
uint64_t bj_get_time_counter | ( | void | ) |
This function returns a time counter in platform-dependent ticks. To convert the value to seconds, divide it by the result of bj_get_time_frequency or just call bj_get_time.
uint64_t bj_get_time_frequency | ( | void | ) |
This function returns the number of ticks per second of the high-resolution counter. It is used in conjunction with bj_get_time_counter to compute durations.
void bj_sleep | ( | int | milliseconds | ) |
This function puts the current thread to sleep for at least the specified number of milliseconds. The actual sleep duration may be longer depending on system timing.
milliseconds | The number of milliseconds to sleep. |