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

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

Update generics paper benchmarks

  • Property mode set to 100644
File size: 428 bytes
RevLine 
[d919f47]1#pragma once
2
[309be81]3#include <stdio.h>
4#include <time.h>
5
[d919f47]6 #define N 50000000
7 
[309be81]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) { \
[d919f47]14        clock_t _start, _end; \
15        _start = clock(); \
[309be81]16        code \
[d919f47]17        _end = clock(); \
18        printf("%s:\t%7ld ms\n", name, ms_between(_start, _end)); \
[309be81]19}
20
[d919f47]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.