Changeset b4107c8 for benchmark/ctxswitch/upp_cor.cc
- Timestamp:
- Jan 7, 2020, 3:50:56 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 580c11b
- Parents:
- 846c026
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/ctxswitch/upp_cor.cc
r846c026 rb4107c8 4 4 5 5 _Coroutine GreatSuspender { 6 public:7 GreatSuspender() {8 resume();9 }10 11 void do_resume() {12 resume();13 }14 private:15 6 void main() { 16 7 while( true ) { … … 18 9 } 19 10 } 11 public: 12 void do_resume() { 13 resume(); 14 } 20 15 }; 21 22 int main(int argc, char* argv[]) { 16 int main( int argc, char * argv[] ) { 17 BENCH_START() 23 18 GreatSuspender s; 24 25 19 BENCH( 26 for (size_t i = 0; i < n; i++) {20 for (size_t i = 0; i < times; i++) { 27 21 s.do_resume(); 28 22 }, 29 23 result 30 24 ) 25 printf( "%g\n", result ); 26 } 31 27 32 printf("%g\n", result); 33 } 28 // Local Variables: // 29 // tab-width: 4 // 30 // End: //
Note: See TracChangeset
for help on using the changeset viewer.