How to use the perf_hooks.performance.now function in perf_hooks

To help you get started, we’ve selected a few perf_hooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Wulf / nodehun / test / performance / performance.ts View on Github external
const suggestSync3Test = (word: string): number => {
  let start = performance.now()
  nodehun3.suggestSync(word)
  let end = performance.now()
  return end - start
}
github node-webrtc / node-webrtc / test / latency.js View on Github external
remoteDataChannel.addEventListener('message', ({ data }) => {
    if (times.length < n) {
      const timestamp = Number.parseFloat(data);
      const time = performance.now() - timestamp;
      times.push(time);
    }
  });
github fuse-box / fuse-box / src / transform / _benchmark.ts View on Github external
function measure(name: string, fn: () => void) {
  const start = performance.now();
  fn();
  const time = performance.now() - start;
  if (!result[name]) {
    result[name] = [];
  }
  result[name].push(time);
  //console.log(`${name} in: ${time}ms`);
  return name;
}
github fuse-box / fuse-box / src / _experimental / typescript / _benchmark.ts View on Github external
function measure(name: string, fn: () => void) {
	const start = performance.now();
	fn();
	const time = performance.now() - start;
	if (!result[name]) {
		result[name] = [];
	}
	result[name].push(time);
	//console.log(`${name} in: ${time}ms`);
	return name;
}
github fuse-box / fuse-box / playground / bench.ts View on Github external
function measure(name: string, fn: () => void) {
  const start = performance.now();
  fn();
  const time = performance.now() - start;
  if (!result[name]) {
    result[name] = [];
  }
  result[name].push(time);
  //console.log(`${name} in: ${time}ms`);
  return name;
}
github fuse-box / fuse-box / src / analysis / _benchmark.ts View on Github external
function measure(name: string, fn: () => void) {
  const start = performance.now();
  fn();
  const time = performance.now() - start;
  if (!result[name]) {
    result[name] = [];
  }
  result[name].push(time);
  //console.log(`${name} in: ${time}ms`);
  return name;
}
github sj-freitas / forofa / examples / index.js View on Github external
const doTest = (testId, numberOfTries, testMethod) => {
  let totalTime = 0;
  for (let i = 0; i
github MephisTools / diablo2-protocol / lib / server / createServerSid.js View on Github external
clientSid.on('SID_PING', ({ value }) => {
      console.log('The client took', (performance.now() - t0).toFixed(2), 'ms to respond')
      if (performance.now() - t0 > 5000) {
        clientSid.socket.destroy()
      }
    })
github cliqz-oss / browser-core / benchmarks / url_parse.js View on Github external
function test(fn, repeats = 1) {
  const start = performance.now();
  for (let r = 0; r < repeats; r += 1) {
    for (let i = 0; i < urls.length; i += 1) {
      fn(urls[i]);
    }
  }
  return performance.now() - start;
}
github cliqz-oss / browser-core / benchmarks / url_parse.js View on Github external
function test(fn, repeats = 1) {
  const start = performance.now();
  for (let r = 0; r < repeats; r += 1) {
    for (let i = 0; i < urls.length; i += 1) {
      fn(urls[i]);
    }
  }
  return performance.now() - start;
}

perf_hooks

placeholder for Node core module

MIT
Latest version published 7 years ago

Package Health Score

47 / 100
Full package analysis

Similar packages