summaryrefslogtreecommitdiff
path: root/src/perf.h
blob: 25190a8818bffb940722c2cf3be8d2977e57d0d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
#if defined DEBUG || defined PERF_DEBUG
#include "typedef.h"

struct PERF_DATA {
  U64 ticks;
  U64 lastwrites;
  U64 lastreads;
  U64 avgwrites;
  U64 avgreads;

  U64 writectr;
  U64 readctr;
};

extern void perf_loop_begin();
extern void perf_loop_end();

extern PERF_DATA perf;
#define perf_run_metric( x ) x()
#else
#define perf_run_metric( x )
#endif