Closed lovanya closed 6 years ago
import * as SpeedTest from 'speedtest-net';
let testRun = SpeedTest({maxTime:5000}); testRun.on('testserver', server => { console.dir(server); });
run this in the browser, and it threw an error: TypeError: process.hrtime is not a function
The speedtest.net module doesn't work in the browser.
I got it. I added 'process.hrtime = require('browser-process-hrtime')' to index.js and installed the plugin 'browser-process-hrtime'. and it works now
import * as SpeedTest from 'speedtest-net';
let testRun = SpeedTest({maxTime:5000}); testRun.on('testserver', server => { console.dir(server); });
run this in the browser, and it threw an error: TypeError: process.hrtime is not a function