Try moving some data to see how much is being moved
var n = 4, chk=5*1024;
var tdata=new Uint8Array(chk);
var i;
for(i=0;i<1024;i++){
tdata[i]=0x30;
tdata[i+1024]=0x31;
tdata[i+1024*2]=0x32;
tdata[i+1024*3]=0x33;
tdata[i+1024*4]=0x34;
}//next i
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
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Try moving some data to see how much is being moved
Saved the page as test.txt and it contains 20 kB of data.
1 Attachment