Ignore:
Timestamp:
Apr 15, 2017, 7:09:59 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
c57d1935
Parents:
308880c
Message:

Minor cleanup, also filled in benchmark source appendix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/bench.h

    r308880c ra381b46  
    11#pragma once
    2 
    32#include <stdio.h>
    43#include <time.h>
    54
    6 #ifndef N
     5long ms_between(clock_t start, clock_t end) { return (end - start) / (CLOCKS_PER_SEC / 1000); }
     6
    77#define N 40000000
    8 #endif
    9 
    10 long ms_between(clock_t start, clock_t end) {
    11         return (end - start) / (CLOCKS_PER_SEC / 1000);
    12 }
    13 
    148#define TIMED(name, code) { \
    159        volatile clock_t _start, _end; \
     
    1913        printf("%s:\t%8ld ms\n", name, ms_between(_start, _end)); \
    2014}
    21 
    2215#define REPEAT_N_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } )
    23 
    2416#define REPEAT_TIMED(name, code) REPEAT_N_TIMED(name, N, code)
Note: See TracChangeset for help on using the changeset viewer.