source: doc/generic_types/evaluation/bench.h@ 122aecd

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 122aecd was 122aecd, checked in by Aaron Moss <a3moss@…>, 9 years ago

Expand benchmarks

  • Property mode set to 100644
File size: 420 bytes
Line 
1#include <stdio.h>
2#include <time.h>
3
4 // #define N 50000000
5 #define N 5
6
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 clock_t start, end; \
14 start = clock(); \
15 code \
16 end = clock(); \
17 printf("%s:\t%7ld 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.