source:
benchmark/ctxswitch/cfa_cor.cfa
@
da7454c
Last change on this file since da7454c was dc33b5b, checked in by , 5 years ago | |
---|---|
|
|
File size: 386 bytes |
Rev | Line | |
---|---|---|
[73abe95] | 1 | #include <kernel.hfa> |
2 | #include <thread.hfa> | |
[de90452] | 3 | |
[8cb6fcd] | 4 | #include "bench.h" |
[de90452] | 5 | |
[b510ac2] | 6 | coroutine GreatSuspender {}; |
[de90452] | 7 | |
[f1dd17a] | 8 | void ?{}( GreatSuspender & this ) { |
[de90452] | 9 | prime(this); |
10 | } | |
11 | ||
[ffe2fad] | 12 | void main( __attribute__((unused)) GreatSuspender & this ) { |
[de90452] | 13 | while( true ) { |
14 | suspend(); | |
15 | } | |
16 | } | |
17 | ||
[034165a] | 18 | int main(int argc, char* argv[]) { |
[de90452] | 19 | GreatSuspender s; |
20 | ||
[034165a] | 21 | BENCH( |
[dc33b5b] | 22 | for ( i; n ) { |
[b7170a64] | 23 | resume( s ); |
24 | }, | |
[034165a] | 25 | result |
26 | ) | |
[de90452] | 27 | |
[dc33b5b] | 28 | printf("%g\n", result); |
29 | } |
Note: See TracBrowser
for help on using the repository browser.