var times = 1000000 var argc = process.argv.length // node, path if ( argc > 3 ) process.exit( 1 ) if ( argc == 3 ) times = Number( process.argv[2] ) var p = new Promise( function( rs ) { resolve = rs; } ); for ( var i = 0; i < times; i += 1 ) { p = p.then( () => { return } ); } p = p.then( () => { hrend = process.hrtime( hrstart ) var dur = (1000000000 * hrend[0] + hrend[1]) / times console.log( dur ) } ); var hrstart = process.hrtime() resolve(); // Local Variables: // // tab-width: 4 // // compile-command: "nodejs node_await.js" // // End: //