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 9f575ea was             c12869e, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago           | 
        
        
          | 
             
update benchmarks for concurrency paper 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            516 bytes
           | 
        
      
      
| Rev | Line |   | 
|---|
| [b4107c8] | 1 | var times = 50000000
 | 
|---|
 | 2 | var argc = process.argv.length // node, path
 | 
|---|
 | 3 | if ( argc > 3 ) process.exit( 1 )
 | 
|---|
 | 4 | if ( argc == 3 ) times = Number( process.argv[2] )
 | 
|---|
 | 5 | 
 | 
|---|
 | 6 | function * coroutine() {
 | 
|---|
 | 7 |         while ( true ) {
 | 
|---|
 | 8 |                 yield
 | 
|---|
 | 9 |         }
 | 
|---|
 | 10 | }
 | 
|---|
 | 11 | cor = coroutine()
 | 
|---|
 | 12 | 
 | 
|---|
 | 13 | var hrstart = process.hrtime()
 | 
|---|
 | 14 | for ( var i = 0; i < times; i += 1 ) {
 | 
|---|
 | 15 |         cor.next();
 | 
|---|
 | 16 | }
 | 
|---|
 | 17 | hrend = process.hrtime( hrstart )
 | 
|---|
 | 18 | var dur = (1000000000 * hrend[0] + hrend[1]) / times
 | 
|---|
 | 19 | console.log( dur )
 | 
|---|
 | 20 | 
 | 
|---|
 | 21 | // Local Variables: //
 | 
|---|
 | 22 | // tab-width: 4 //
 | 
|---|
| [c12869e] | 23 | // compile-command: "nodejs node_cor.js" //
 | 
|---|
| [b4107c8] | 24 | // End: //
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.