source: doc/generic_types/evaluation/cfa-bench.c @ d919f47

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

Expand benchmarks

  • Property mode set to 100644
File size: 335 bytes
Line 
1#include <stdlib.h>
2#include "bench.h"
3#include "cfa-stack.h"
4
5int main(int argc, char** argv) {
6        srand(20171025);
7
8        stack(int) s;
9        REPEAT_TIMED( "push_int",
10                push( &s, rand() );
11        )
12
13        stack(int) t;
14        TIMED( "copy_int", 
15                t = s;
16        )
17
18        TIMED( "clear_int", 
19                clear( &s );
20        )
21
22        int sum;
23        REPEAT_TIMED( "pop_int", 
24                sum += pop( &t );
25        )
26}
Note: See TracBrowser for help on using the repository browser.