Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const suggestSync3Test = (word: string): number => {
let start = performance.now()
nodehun3.suggestSync(word)
let end = performance.now()
return end - start
}
remoteDataChannel.addEventListener('message', ({ data }) => {
if (times.length < n) {
const timestamp = Number.parseFloat(data);
const time = performance.now() - timestamp;
times.push(time);
}
});
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;
}
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;
}
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;
}
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;
}
const doTest = (testId, numberOfTries, testMethod) => {
let totalTime = 0;
for (let i = 0; i
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()
}
})
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;
}
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;
}