static void perf_interrupt(struct perf *p) { state_must_be(p, PS_METER_RUNNING); update_sofar(p); p->state = PS_METER_INTERRUPTED; }
static void perf_stop (struct perf *p) { state_must_be (p, PS_METER_RUNNING); update_sofar (p); p->sum += p->sofar; if (p->sofar > p->max) p->max = p->sofar; p->count += 1.0; p->sofar = 0.0; p->state = PS_INITIAL; }