@indutny/bencher 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,7 @@ const BOLD = 1;
36
36
  const ITALIC = 3;
37
37
  // Go back to previous line, clear the line
38
38
  const PREV_LINE = '\x1b[F\x1b[K';
39
+ // From https://github.com/mayuki/Kurukuru
39
40
  const SPINNER = ['⠋', '⠙', '⠸', '⠴', '⠦', '⠇'];
40
41
  const TICK_FREQUENCY = 1 / 4;
41
42
  // t-distribution value for large sample count and p=0.001
@@ -113,7 +114,8 @@ async function main() {
113
114
  const { ops, maxError, usedSamples } = run(m, {
114
115
  onTick,
115
116
  });
116
- const stats = style(`(±${nice(maxError)}, p=${P_VALUE}, n=${usedSamples})`, ITALIC);
117
+ const stats = '\x1b[90m' +
118
+ style(`(±${nice(maxError)}, p=${P_VALUE}, n=${usedSamples})`, ITALIC);
117
119
  (0, fs_1.writeSync)(process.stdout.fd, `${PREV_LINE}${paddedName} ${nice(ops)} ops/sec ${stats}\n`);
118
120
  }
119
121
  }
@@ -246,7 +248,7 @@ function style(text, code) {
246
248
  function nice(n) {
247
249
  let result = n.toFixed(1);
248
250
  for (let i = result.length - 5; i > 0; i -= 3) {
249
- result = result.slice(0, i) + "'" + result.slice(i);
251
+ result = result.slice(0, i) + '’' + result.slice(i);
250
252
  }
251
253
  return result;
252
254
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indutny/bencher",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Simple benchmarking tool",
5
5
  "bin": {
6
6
  "bencher": "./dist/bin/bencher.js"