Ignore:
Timestamp:
Apr 15, 2017, 7:09:59 PM (4 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-env, no_list, persistent-indexer, 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.