aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/clock.c
blob: 506dadc3972e6c879ccf403a4c067b86ed5f74f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "cycles.h"

static cycle_t total_clock, last_start;

void clock_start(void) {
  last_start = get_cycle();
}

void clock_stop(void) {
  total_clock += get_cycle() - last_start;
}

cycle_t get_total_clock(void) {
  return total_clock;
}