KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Maintaining time since system boot. More...
Functions | |
void | timer_ms_enable (void) |
Enable the millisecond timer. | |
void | timer_ms_disable (void) |
Disable the millisecond timer. | |
void | timer_ms_gettime (uint32_t *secs, uint32_t *msecs) |
Get the current uptime of the system (in secs and millisecs). | |
uint64_t | timer_ms_gettime64 (void) |
Get the current uptime of the system (in milliseconds). | |
void | timer_us_gettime (uint32_t *secs, uint32_t *usecs) |
Get the current uptime of the system (in secs and microsecs). | |
uint64_t | timer_us_gettime64 (void) |
Get the current uptime of the system (in microseconds). | |
void | timer_ns_gettime (uint32_t *secs, uint32_t *nsecs) |
Get the current uptime of the system (in secs and nanosecs). | |
uint64_t | timer_ns_gettime64 (void) |
Get the current uptime of the system (in nanoseconds). | |
Maintaining time since system boot.
This API provides methods for querying the current system boot time or uptime since KOS started at various resolutions. You can use this timing for ticks, delta time, or frame deltas for games, profilers, or media decoding.
void timer_ms_disable | ( | void | ) |
Disable the millisecond timer.
This function disables the timer used for the gettime functions. Generally, you will not want to do this, unless you have some need to use the timer TMU2 for something else.
void timer_ms_enable | ( | void | ) |
Enable the millisecond timer.
This function enables the timer used for the gettime functions. This is on by default. These functions use TMU2 to do their work.
void timer_ms_gettime | ( | uint32_t * | secs, |
uint32_t * | msecs ) |
Get the current uptime of the system (in secs and millisecs).
This function retrieves the number of seconds and milliseconds since KOS was started.
secs | A pointer to store the number of seconds since boot into. |
msecs | A pointer to store the number of milliseconds past a second since boot. |
uint64_t timer_ms_gettime64 | ( | void | ) |
Get the current uptime of the system (in milliseconds).
This function retrieves the number of milliseconds since KOS was started. It is equivalent to calling timer_ms_gettime() and combining the number of seconds and milliseconds into one 64-bit value.
void timer_ns_gettime | ( | uint32_t * | secs, |
uint32_t * | nsecs ) |
Get the current uptime of the system (in secs and nanosecs).
This function retrieves the number of seconds and nanoseconds since KOS was started.
secs | A pointer to store the number of seconds since boot into. |
nsecs | A pointer to store the number of nanoseconds past a second since boot. |
uint64_t timer_ns_gettime64 | ( | void | ) |
Get the current uptime of the system (in nanoseconds).
This function retrieves the number of nanoseconds since KOS was started.
void timer_us_gettime | ( | uint32_t * | secs, |
uint32_t * | usecs ) |
Get the current uptime of the system (in secs and microsecs).
This function retrieves the number of seconds and microseconds since KOS was started.
secs | A pointer to store the number of seconds since boot into. |
usecs | A pointer to store the number of microseconds past a second since boot. |
uint64_t timer_us_gettime64 | ( | void | ) |
Get the current uptime of the system (in microseconds).
This function retrieves the number of microseconds since KOS was started.