File Explorer

/var/runtime/node_modules/@aws-sdk/node_modules/mqtt-packet/benchmarks

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

0 dirs
4 files
generate.js450 B · 27 lines
const mqtt = require('../')const max = 100000let iconst buf = Buffer.from('test') // initialize itmqtt.generate({  cmd: 'publish',  topic: 'test',  payload: buf}) const start = Date.now() for (i = 0; i < max; i++) {  mqtt.generate({    cmd: 'publish',    topic: 'test',    payload: buf  })} const time = Date.now() - startconsole.log('Total time', time)console.log('Total packets', max)console.log('Packet/s', max / time * 1000)