source:
benchmark/ctxswitch/cfa_cor.cfa@
c93fd72
| Last change on this file since c93fd72 was b4107c8, checked in by , 6 years ago | |
|---|---|
|
|
| File size: 408 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 {}; |
| [ffe2fad] | 7 | void main( __attribute__((unused)) GreatSuspender & this ) { |
| [b4107c8] | 8 | while ( true ) { |
| [de90452] | 9 | suspend(); |
| 10 | } | |
| 11 | } | |
| [b4107c8] | 12 | int main( int argc, char * argv[] ) { |
| 13 | BENCH_START() | |
| [de90452] | 14 | GreatSuspender s; |
| [034165a] | 15 | BENCH( |
| [b4107c8] | 16 | for ( i; times ) { |
| [b7170a64] | 17 | resume( s ); |
| 18 | }, | |
| [034165a] | 19 | result |
| 20 | ) | |
| [b4107c8] | 21 | printf( "%g\n", result ); |
| [dc33b5b] | 22 | } |
| [b4107c8] | 23 | |
| 24 | // Local Variables: // | |
| 25 | // tab-width: 4 // | |
| 26 | // End: // |
Note:
See TracBrowser
for help on using the repository browser.