npm.io
2.1.0 • Published 1 year ago

@remusao/bench

Licence
MPL-2.0
Version
2.1.0
Deps
1
Size
22 kB
Vulns
0
Weekly
0
Stars
15

@remusao/bench

Easily measure performance of a function against array of inputs.

import bench from '@remusao/bench';

function getLengthOfUrl(url: string): number {
  return url.length;
}

const opsPerSecond = bench(getLengthOfUrl, [
  '',
  'https://example.com',
  'http://foo.bar',
]);