source: benchmark/ctxswitch/cfa_cor.cfa@ 9e1fa35

ADT arm-eh ast-experimental enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr pthread-emulation qualifiedEnum
Last change on this file since 9e1fa35 was b4107c8, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

update existing benchmarks for changes to bench.h, add new benchmarks in new programming languages

  • Property mode set to 100644
File size: 408 bytes
RevLine 
[73abe95]1#include <kernel.hfa>
2#include <thread.hfa>
[de90452]3
[8cb6fcd]4#include "bench.h"
[de90452]5
[b510ac2]6coroutine GreatSuspender {};
[ffe2fad]7void main( __attribute__((unused)) GreatSuspender & this ) {
[b4107c8]8 while ( true ) {
[de90452]9 suspend();
10 }
11}
[b4107c8]12int 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.