KallistiOS git master
Independent SDK for the Sega Dreamcast
|
High-resolution performance counter-based timer API More...
Functions | |
void | perf_cntr_timer_enable (void) |
Enable the nanosecond timer. | |
void | perf_cntr_timer_disable (void) |
Disable the nanosecond timer. | |
bool | perf_cntr_timer_enabled (void) |
Check whether the nanosecond timer is enabled. | |
uint64_t | perf_cntr_timer_ns (void) |
Gets elapsed CPU time (in nanoseconds) | |
High-resolution performance counter-based timer API
This API allows for using the performance counters as high-resolution general-purpose interval timer with 5ns ticks. It does this by configuring PRFC0 in PMCR_ELAPSED_TIME_MODE.
void perf_cntr_timer_disable | ( | void | ) |
Disable the nanosecond timer.
This function disables the performance counter used for the perf_cntr_timer_ns() function.
void perf_cntr_timer_enable | ( | void | ) |
Enable the nanosecond timer.
This function enables the performance counter used for the perf_cntr_timer_ns() function.
bool perf_cntr_timer_enabled | ( | void | ) |
Check whether the nanosecond timer is enabled.
Queries the configuration of PRFC0 to check whether it's currently acting as the nanosecond timer.
true | The nanosecond timer is configured and running |
false | The nanosecond timer is not configured and/or isn't running |
uint64_t perf_cntr_timer_ns | ( | void | ) |
Gets elapsed CPU time (in nanoseconds)
This function retrieves the total amount of active CPU time since perf_cntr_timer_enabled() was called.