source: benchmark/ctxswitch/cfa_cor.cfa @ 665f432

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

update benchmarks and add benchmarks for qthreads

  • Property mode set to 100644
File size: 386 bytes
Line 
1#include <kernel.hfa>
2#include <thread.hfa>
3
4#include "bench.h"
5
6coroutine GreatSuspender {};
7
8void ?{}( GreatSuspender & this ) {
9        prime(this);
10}
11
12void main( __attribute__((unused)) GreatSuspender & this ) {
13        while( true ) {
14                suspend();
15        }
16}
17
18int main(int argc, char* argv[]) {
19        GreatSuspender s;
20
21        BENCH(
22                for ( i; n ) {
23                        resume( s );
24                },
25                result
26        )
27
28        printf("%g\n", result);
29}
Note: See TracBrowser for help on using the repository browser.