A variable timing sample
Suppose repeated run times have a mean of 0.6 seconds and a standard deviation of 0.31 seconds. Their relative standard deviation is 0.31 / 0.6 ≈ 0.52, or 52%. The spread is substantial relative to the time being measured. section 16.4
Relative standard deviation is σ(S) / μ(S): standard deviation divided by the sample mean. For run times, it should be in a low percentage range. A high value may indicate variation in the computation, disturbance of the measurement, or both; it does not identify which cause is responsible. section 16.4
Listing 16.5 Printing time stats with stats_mean and stats_rsdev_unbiased
for (unsigned i = 0; i < loops; i++) {
double mean = stats_mean(&statistic[i]);
double rsdev = stats_rsdev_unbiased(&statistic[i]);
printf("loop %u: E(t) (sec):\t%5.2e ± %4.02f%%,\tloop body %5.2e\n",
i, mean, 100.0*rsdev, mean/iterations);
}
The C listing prints a mean run time alongside `100.0*rsdev`, converting the relative standard deviation to a percentage. section 16.4

