Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Timing Measurement APIs. More...
Functions | |
void | timing_init (void) |
Initialize the timing subsystem. More... | |
void | timing_start (void) |
Signal the start of the timing information gathering. More... | |
void | timing_stop (void) |
Signal the end of the timing information gathering. More... | |
static timing_t | timing_counter_get (void) |
Return timing counter. More... | |
static uint64_t | timing_cycles_get (volatile timing_t *const start, volatile timing_t *const end) |
Get number of cycles between start and end . More... | |
static uint64_t | timing_freq_get (void) |
Get frequency of counter used (in Hz). More... | |
static uint64_t | timing_cycles_to_ns (uint64_t cycles) |
Convert number of cycles into nanoseconds. More... | |
static uint64_t | timing_cycles_to_ns_avg (uint64_t cycles, uint32_t count) |
Convert number of cycles into nanoseconds with averaging. More... | |
static uint32_t | timing_freq_get_mhz (void) |
Get frequency of counter used (in MHz). More... | |
Timing Measurement APIs.
|
inlinestatic |
#include <include/timing/timing.h>
Get number of cycles between start
and end
.
For some architectures or SoCs, the raw numbers from counter need to be scaled to obtain actual number of cycles.
start | Pointer to counter at start of a measured execution. |
end | Pointer to counter at stop of a measured execution. |
#include <include/timing/timing.h>
Convert number of cycles
into nanoseconds.
cycles | Number of cycles |
#include <include/timing/timing.h>
Convert number of cycles
into nanoseconds with averaging.
cycles | Number of cycles |
count | Times of accumulated cycles to average over |
#include <include/timing/timing.h>
Get frequency of counter used (in Hz).
#include <include/timing/timing.h>
Get frequency of counter used (in MHz).
#include <include/timing/timing.h>
Initialize the timing subsystem.
Perform the necessary steps to initialize the timing subsystem.
#include <include/timing/timing.h>
Signal the start of the timing information gathering.
Signal to the timing subsystem that timing information will be gathered from this point forward.
#include <include/timing/timing.h>
Signal the end of the timing information gathering.
Signal to the timing subsystem that timing information is no longer being gathered from this point forward.