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

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 d919f47 was d919f47, checked in by Aaron Moss <a3moss@…>, 9 years ago

Update generics paper benchmarks

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