source:
benchmark/ctxswitch/cfa_thrd2.cfa
@
807a632
Last change on this file since 807a632 was dc33b5b, checked in by , 5 years ago | |
---|---|
|
|
File size: 328 bytes |
Rev | Line | |
---|---|---|
[73abe95] | 1 | #include <thread.hfa> |
[6810fcb] | 2 | |
3 | #include "bench.h" | |
4 | ||
5 | volatile bool done = false; | |
6 | ||
7 | thread Fibre {}; | |
8 | ||
[ffe2fad] | 9 | void main(__attribute__((unused)) Fibre & this) { |
[6810fcb] | 10 | while(!done) { |
11 | yield(); | |
12 | } | |
13 | } | |
14 | ||
15 | int main(int argc, char* argv[]) { | |
16 | Fibre f1; | |
17 | BENCH( | |
[dc33b5b] | 18 | for ( i; n ) { |
[6810fcb] | 19 | yield(); |
20 | }, | |
21 | result | |
22 | ) | |
23 | ||
[dc33b5b] | 24 | printf("%g\n", result); |
[6810fcb] | 25 | done = true; |
26 | return 0; | |
[dc33b5b] | 27 | } |
Note: See TracBrowser
for help on using the repository browser.