source: benchmark/ctxswitch/upp_cor.cc @ 9e63a2b

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 9e63a2b was b4107c8, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

update existing benchmarks for changes to bench.h, add new benchmarks in new programming languages

  • Property mode set to 100644
File size: 406 bytes
Line 
1#include <cstdio>
2
3#include "bench.h"
4
5_Coroutine GreatSuspender {
6        void main() {
7                while( true ) {
8                        suspend();
9                }
10        }
11  public:
12        void do_resume() {
13                resume();
14        }
15};
16int main( int argc, char * argv[] ) {
17        BENCH_START()
18        GreatSuspender s;
19        BENCH(
20                for (size_t i = 0; i < times; i++) {
21                        s.do_resume();
22                },
23                result
24        )
25        printf( "%g\n", result );
26}
27
28// Local Variables: //
29// tab-width: 4 //
30// End: //
Note: See TracBrowser for help on using the repository browser.