source: benchmark/ctxswitch/node_cor.js @ 580c11b

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 580c11b was b4107c8, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

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

  • Property mode set to 100644
File size: 514 bytes
Line 
1var times = 50000000
2var argc = process.argv.length // node, path
3if ( argc > 3 ) process.exit( 1 )
4if ( argc == 3 ) times = Number( process.argv[2] )
5
6function * coroutine() {
7        while ( true ) {
8                yield
9        }
10}
11cor = coroutine()
12
13var hrstart = process.hrtime()
14for ( var i = 0; i < times; i += 1 ) {
15        cor.next();
16}
17hrend = process.hrtime( hrstart )
18var dur = (1000000000 * hrend[0] + hrend[1]) / times
19console.log( dur )
20
21// Local Variables: //
22// tab-width: 4 //
23// compile-command: "node node_cor.js" //
24// End: //
Note: See TracBrowser for help on using the repository browser.