• Please post the Arduino code for comparison.

    Here is another approach:

    Try moving the new UintArray(chk) to a Global scope

    //Global scope
    var n = 4, chk=5*1024;
    var tdata=new Uint8Array(chk);
    
    function onPageRequest(req, res) {
      res.writeHead(200, {'Content-Type': 'text/plain'});
      var t=getTime();
      res.on('drain',function() {
      print("n=",n,"t:",(getTime()-t).toFixed(3),"sec");
      if (n===0){ res.end();
       print("n=",n,"t:",(getTime()-t).toFixed(3),"sec");
      }else {  
       res.write(E.toString(tdata));  
        n--;
       }//end else
      });//end opr
     }//end function
    
    IP=  192.168.1.9
    null
    Wi-Fi Connected
    n= 4 t: 0.008 sec
    n= 3 t: 1.097 sec
    n= 2 t: 2.214 sec
    n= 1 t: 3.447 sec
    
About