benilla-re systems structs docs

EstimateCounterRate

function · core · primitive

Address
0x42ba20 · 103 bytes, up to 0x42ba86
Meaning
Returns counter ticks per second over a span of samples, skipping a zero span
Confidence
verified, proof one
Finding
core/time#calibration-thread

Finding: Calibration thread in core: time

The time manager starts a thread, OsTime, which samples the counter and GetTickCount every 250 ms into a ring of 121 samples and estimates the counter's rate over 1, 4, 20 and 120 samples. It picks the shortest span whose estimate strays from the stored rate beyond its tolerance, capped where neighbouring estimates disagree. In mode 0, a pick of the 20- or 120-sample span, or none, stores the 120-sample estimate and switches to mode 1; a 1- or 4-sample pick stores that estimate and stays. In mode 1 a pick stores its estimate and rescales, and returns to mode 0 when the short-span estimates disagree. The switch is not one-way.

The derivation is in the doc.

Callers 1

Callees 2

Calls and jumps by a bare address, from tables/calls.tsv.