PX4 Firmware
PX4 Autopilot Software http://px4.io
test_microbench_hrt.cpp File Reference

Tests for the microbench high resolution timer. More...

#include <unit_test.h>
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#include <drivers/drv_hrt.h>
#include <perf/perf_counter.h>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/micro_hal.h>
Include dependency graph for test_microbench_hrt.cpp:

Go to the source code of this file.

Classes

class  MicroBenchHRT::MicroBenchHRT
 

Namespaces

 MicroBenchHRT
 

Macros

#define PERF(name, op, count)
 

Functions

void MicroBenchHRT::lock ()
 
void MicroBenchHRT::unlock ()
 
template<typename T >
MicroBenchHRT::random (T min, T max)
 
 MicroBenchHRT::ut_declare_test_c (test_microbench_hrt, MicroBenchHRT) bool MicroBenchHRT
 

Detailed Description

Tests for the microbench high resolution timer.

Definition in file test_microbench_hrt.cpp.

Macro Definition Documentation

◆ PERF

#define PERF (   name,
  op,
  count 
)
Value:
do { \
px4_usleep(1000); \
reset(); \
perf_counter_t p = perf_alloc(PC_ELAPSED, name); \
for (int i = 0; i < count; i++) { \
lock(); \
perf_begin(p); \
op; \
perf_end(p); \
unlock(); \
reset(); \
} \
perf_print_counter(p); \
perf_free(p); \
} while (0)
measure the time elapsed performing an event
Definition: perf_counter.h:56
#define perf_alloc(a, b)
Definition: px4io.h:59
const char * name
Definition: tests_main.c:58

Definition at line 72 of file test_microbench_hrt.cpp.

Referenced by MicroBenchHRT::ut_declare_test_c().