source: src/benchmark/ctxswitch/cfa_cor.c @ 034165a

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since 034165a was 034165a, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

renamed and updated benchmarks for consistency

  • Property mode set to 100644
File size: 516 bytes
Line 
1#include <fstream>
2#include <stdlib>
3#include <thread>
4
5#include "bench.h"
6
7coroutine GreatSuspender {};
8
9void ?{}( GreatSuspender & this ) {
10        prime(this);
11}
12
13void main( GreatSuspender & this )
14{
15        while( true ) {
16                suspend();
17        }
18}
19
20void resumer( GreatSuspender & this, const unsigned int NoOfTimes ) {
21        for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) {
22                resume( this );
23        }
24}
25
26int main(int argc, char* argv[]) {
27        GreatSuspender s;
28
29        BENCH(
30                resumer( s, NoOfTimes );,
31                result
32        )
33
34        sout | result | endl;
35}
Note: See TracBrowser for help on using the repository browser.