Zephyr Scientific Library (zscilib)
Macros
instrumentation.h File Reference
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zsl/zsl.h>

Go to the source code of this file.

Macros

#define ZSL_INSTR_START(t)
 Reads the high-precision timer start time. More...
 
#define ZSL_INSTR_STOP(t)
 Reads the high-precision timer stop time and converts to ns. This function modifies the value of t to store the execution time in ns. More...
 

Macro Definition Documentation

◆ ZSL_INSTR_START

#define ZSL_INSTR_START (   t)
Value:
do { \
t = k_cycle_get_32(); \
} while (0);

Reads the high-precision timer start time.

Definition at line 17 of file instrumentation.h.

◆ ZSL_INSTR_STOP

#define ZSL_INSTR_STOP (   t)
Value:
do { \
uint32_t end = k_cycle_get_32(); \
t = end < t ? 0xFFFFFFFF - t + end : end - t; \
t = k_cyc_to_ns_floor32(t); \
} while (0);

Reads the high-precision timer stop time and converts to ns. This function modifies the value of t to store the execution time in ns.

Definition at line 25 of file instrumentation.h.