source: benchmark/ctxswitch/cfa_thrd2.cfa @ dc33b5b

arm-ehenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-expr
Last change on this file since dc33b5b was dc33b5b, checked in by Peter A. Buhr <pabuhr@…>, 3 years ago

update benchmarks and add benchmarks for qthreads

  • Property mode set to 100644
File size: 328 bytes
Line 
1#include <thread.hfa>
2
3#include "bench.h"
4
5volatile bool done = false;
6
7thread Fibre {};
8
9void main(__attribute__((unused)) Fibre & this) {
10        while(!done) {
11                yield();
12        }
13}
14
15int main(int argc, char* argv[]) {
16        Fibre f1;
17        BENCH(
18                for ( i; n ) {
19                        yield();
20                },
21                result
22        )
23
24        printf("%g\n", result);
25        done = true;
26        return 0;
27}
Note: See TracBrowser for help on using the repository browser.