Loading...
Searching...
No Matches

Measure time with ztimer. More...

Detailed Description

Measure time with ztimer.

Author
Benjamin Valentin benja.nosp@m.min..nosp@m.valen.nosp@m.tin@.nosp@m.ml-pa.nosp@m..com

Data Structures

struct  ztimer_stopwatch_t
 ztimer stop watch struct More...
 

Functions

static void ztimer_stopwatch_init (ztimer_clock_t *clock, ztimer_stopwatch_t *timer)
 Initialize a ztimer stop watch The stop watch is not running yet.
 
static void ztimer_stopwatch_start (ztimer_stopwatch_t *timer)
 Start the stop watch timer.
 
static uint32_t ztimer_stopwatch_measure (ztimer_stopwatch_t *timer)
 Take a measurement from the stop watch timer.
 
static uint32_t ztimer_stopwatch_reset (ztimer_stopwatch_t *timer)
 Reset the stop watch start time.
 
static void ztimer_stopwatch_stop (ztimer_stopwatch_t *timer)
 Stop the stop watch.
 

Function Documentation

◆ ztimer_stopwatch_init()

static void ztimer_stopwatch_init ( ztimer_clock_t clock,
ztimer_stopwatch_t timer 
)
inlinestatic

Initialize a ztimer stop watch The stop watch is not running yet.

Parameters
[in]clockThe clock to use for the stopwatch
[out]timerThe stop watch clock to initialize

Definition at line 41 of file stopwatch.h.

◆ ztimer_stopwatch_measure()

static uint32_t ztimer_stopwatch_measure ( ztimer_stopwatch_t timer)
inlinestatic

Take a measurement from the stop watch timer.

Parameters
[in]timerThe stop watch timer to take a measurement of
Returns
Timer ticks since the stop watch was started / reset

Definition at line 64 of file stopwatch.h.

◆ ztimer_stopwatch_reset()

static uint32_t ztimer_stopwatch_reset ( ztimer_stopwatch_t timer)
inlinestatic

Reset the stop watch start time.

The Stop Watch will start counting from 0 again.

Parameters
[in]timerThe stop watch timer to reset
Returns
Timer ticks since the last reset / start of the watch

Definition at line 77 of file stopwatch.h.

◆ ztimer_stopwatch_start()

static void ztimer_stopwatch_start ( ztimer_stopwatch_t timer)
inlinestatic

Start the stop watch timer.

Parameters
[in]timerThe stop watch timer to start

Definition at line 51 of file stopwatch.h.

◆ ztimer_stopwatch_stop()

static void ztimer_stopwatch_stop ( ztimer_stopwatch_t timer)
inlinestatic

Stop the stop watch.

The stop watch will no longer run.

Parameters
[in]timerThe stop watch timer to stop

Definition at line 92 of file stopwatch.h.