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 309be81 was
309be81,
checked in by Aaron Moss <a3moss@…>, 7 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 | |
---|
6 | long 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.