This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var latency = new SpeedTest.Latency('samples/empty.bin?' + Math.random()); | |
latency.on('finish', function(size, time) { | |
console.log('Latency: ' + time + ' ms'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var download = new SpeedTest.Download('samples/8mb.bin?' + Math.random()); | |
download.on('progress', function(loaded, total, rate) { | |
var percent = Math.round(loaded / total * 100), | |
kbps = Math.round(rate / 1024); | |
console.log(percent + ' loaded at ' + kbps + ' kbps') | |
} |
NewerOlder