source: doc/generic_types/evaluation/bench.h @ b14dd03

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since b14dd03 was 87c5f40, checked in by Aaron Moss <a3moss@…>, 7 years ago

Update benchmarks to include stack of pairs

  • Property mode set to 100644
File size: 434 bytes
Line 
1#pragma once
2
3#include <stdio.h>
4#include <time.h>
5
6#define N 50000000
7
8long ms_between(clock_t start, clock_t end) {
9        return (end - start) / (CLOCKS_PER_SEC / 1000);
10}
11
12#define TIMED(name, code) { \
13        volatile clock_t _start, _end; \
14        _start = clock(); \
15        code \
16        _end = clock(); \
17        printf("%s:\t%8ld ms\n", name, ms_between(_start, _end)); \
18}
19
20#define REPEAT_TIMED(name, code) TIMED( name, for (int _i = 0; _i < N; ++_i) { code } )
Note: See TracBrowser for help on using the repository browser.