Changeset b7170a64 for src/benchmark/ctxswitch/cfa_cor.c
- Timestamp:
- Oct 26, 2017, 12:16:10 PM (6 years ago)
- 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:
- 6395817
- Parents:
- 4149d9d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/ctxswitch/cfa_cor.c
r4149d9d rb7170a64 1 #include <fstream> 2 #include <stdlib> 1 #include <stdio.h> 3 2 #include <thread> 4 3 … … 11 10 } 12 11 13 void main( GreatSuspender & this ) 14 { 12 void main( GreatSuspender & this ) { 15 13 while( true ) { 16 14 suspend(); 17 }18 }19 20 void resumer( GreatSuspender & this, const unsigned int NoOfTimes ) {21 for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) {22 resume( this );23 15 } 24 16 } … … 28 20 29 21 BENCH( 30 resumer( s, NoOfTimes );, 22 for (size_t i = 0; i < n; i++) { 23 resume( s ); 24 }, 31 25 result 32 26 ) 33 27 34 sout | result | endl;28 printf("%llu\n", result); 35 29 }
Note: See TracChangeset
for help on using the changeset viewer.