medianOf function

num medianOf(
  1. List<num> values
)

Median of values (sorted, middle element).

Runners emit several samples per noisy metric (frame benches swing run-to-run on the same device); every consumer reduces duplicates with this — the recorded golden, the check and the published tables all show the median, not the last (or best) run.

Implementation

num medianOf(List<num> values) {
  final sorted = [...values]..sort();
  return sorted[sorted.length ~/ 2];
}