A statistical sample is a finite set of observed values. For a performance measurement, collect timings from repeated runs rather than treating one timing as definitive. Each observation can vary, and the measurement itself can change the program being measured. section 16.4
Collecting and reporting timings
For each timed interval, `timespec_diff(&t[i+1], &t[i])` produces a duration, and `stats_collect2(&statistic[i], diff)` adds it to the sample. `stats_mean` and `stats_rsdev_unbiased` then report its mean and relative variation. These summaries help distinguish a convincing performance difference from one obscured by variation; they do not prove an algorithm’s complexity. section 16.4
Figure 16.1 Frequency histogram for our sample, showing the frequency with which each of the measured values was obtained
The frequency histogram shows how often each measured value occurred, making the sample’s distribution visible. section 16.4
TAKEAWAY: Account for instrumentation when interpreting a timing sample. A `timespec_get` call takes time and can affect optimization, scheduling, and caches. section 16.4






