source: node_modules/pg-protocol/src/b.ts@ 62b2964

finki-main main
Last change on this file since 62b2964 was 62b2964, checked in by Klimentina Efremova <klimentina08642@…>, 2 weeks ago

Project Handcraft Marketplace

  • Property mode set to 100644
File size: 473 bytes
RevLine 
[62b2964]1// file for microbenchmarking
2
3import { BufferReader } from './buffer-reader'
4
5const LOOPS = 1000
6let count = 0
7const start = performance.now()
8
9const reader = new BufferReader()
10const buffer = Buffer.from([33, 33, 33, 33, 33, 33, 33, 0])
11
12const run = () => {
13 if (count > LOOPS) {
14 console.log(performance.now() - start)
15 return
16 }
17 count++
18 for (let i = 0; i < LOOPS; i++) {
19 reader.setBuffer(0, buffer)
20 reader.cstring()
21 }
22 setImmediate(run)
23}
24
25run()
Note: See TracBrowser for help on using the repository browser.