source: benchmark/ctxswitch/cfa_thrd2.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: 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.