source: doc/papers/OOPSLA17/evaluation/bench.h @ 94429f8

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 94429f8 was f4e3419d, checked in by Peter A. Buhr <pabuhr@…>, 7 years ago

restructure paper documents

  • Property mode set to 100644
File size: 433 bytes
RevLine 
[d919f47]1#pragma once
[309be81]2#include <stdio.h>
3#include <time.h>
4
[a381b46]5long ms_between(clock_t start, clock_t end) { return (end - start) / (CLOCKS_PER_SEC / 1000); }
[309be81]6
[a381b46]7#define N 40000000
[309be81]8#define TIMED(name, code) { \
[b276be5]9        volatile clock_t _start, _end; \
[d919f47]10        _start = clock(); \
[309be81]11        code \
[d919f47]12        _end = clock(); \
[47535a0d]13        printf("%s:\t%8ld ms\n", name, ms_between(_start, _end)); \
[309be81]14}
[c87cd93]15#define REPEAT_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } )
Note: See TracBrowser for help on using the repository browser.