std1.0.0-beta-7 SafeC docs

std :: debug::perf

Struct std::PerfCounter

#include <std/debug/perf.h> source

struct PerfCounter {
    unsigned long long start_val;
    unsigned long long end_val;
    unsigned long long freq_hz;
}

Fields

§unsigned long long start_valsource
§unsigned long long end_valsource
§unsigned long long freq_hzsource

counter frequency (0 = unknown)

Methods

§static struct PerfCounter new()source · definition

A zeroed counter with freq_hz detected from arch-specific sources (calibrated against clock() when hosted; 0 when freestanding).

§void start()source · definition

Start measurement.

§void stop()source · definition

Stop measurement.

§unsigned long long ticks() constsource · definition

Return elapsed counter ticks.

§unsigned long long ns() constsource · definition

Return elapsed nanoseconds (0 if freq unknown).