source: doc/generic_types/evaluation/bench.h@ 309be81

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 stuck-waitfor-destruct with_gc
Last change on this file since 309be81 was 309be81, checked in by Aaron Moss <a3moss@…>, 9 years ago

Started evaluation benchmarks for paper (CFA version doesn't compile yet)

  • Property mode set to 100644
File size: 403 bytes
Line 
1#include <stdio.h>
2#include <time.h>
3
4#define N 200000000
5
6long ms_between(clock_t start, clock_t end) {
7 return (end - start) / (CLOCKS_PER_SEC / 1000);
8}
9
10#define TIMED(name, code) { \
11 clock_t start, end; \
12 start = clock(); \
13 code \
14 end = clock(); \
15 printf("%s:\t%7ld ms\n", name, ms_between(start, end)); \
16}
17
18#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.