{
"$schema": "https://json.schemastore.org/prettierrc",
- "arrowParens": "avoid",
"semi": false,
"singleQuote": true,
"trailingComma": "none"
* @returns
*/
export async function sleep (ms) {
- return new Promise(resolve => setTimeout(resolve, ms))
+ return new Promise((resolve) => setTimeout(resolve, ms))
}
* @param intervalMs
*/
async function setIntervalTimeoutBusyWait (timeoutMs, intervalMs = interval) {
- return new Promise(resolve => {
+ return new Promise((resolve) => {
const tries = Math.round(timeoutMs / intervalMs)
let count = 0
const triesSetInterval = setInterval(() => {
Benchmark.save({ file: 'busy-wait', format: 'json', details: true }),
Benchmark.save({ file: 'busy-wait', format: 'chart.html', details: true }),
Benchmark.save({ file: 'busy-wait', format: 'table.html', details: true })
-).catch(err => {
+).catch((err) => {
console.error(err)
})
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})
Benchmark.save({ file: 'empty-array', format: 'json', details: true }),
Benchmark.save({ file: 'empty-array', format: 'chart.html', details: true }),
Benchmark.save({ file: 'empty-array', format: 'table.html', details: true })
-).catch(err => {
+).catch((err) => {
console.error(err)
})
Benchmark.save({ file: 'fibonacci', format: 'json', details: true }),
Benchmark.save({ file: 'fibonacci', format: 'chart.html', details: true }),
Benchmark.save({ file: 'fibonacci', format: 'table.html', details: true })
-).catch(err => {
+).catch((err) => {
console.error(err)
})
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})
Benchmark.save({ file: 'max', format: 'json', details: true }),
Benchmark.save({ file: 'max', format: 'chart.html', details: true }),
Benchmark.save({ file: 'max', format: 'table.html', details: true })
-).catch(err => {
+).catch((err) => {
console.error(err)
})
*
*/
function promise () {
- return new Promise(resolve => {
+ return new Promise((resolve) => {
resolve()
})
}
}),
Benchmark.add('promise with then().catch()', () => {
asyncFunction()
- .then(r => {
+ .then((r) => {
return r
})
- .catch(e => {
+ .catch((e) => {
console.error(e)
})
}),
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})
format: 'table.html',
details: true
})
-).catch(err => {
+).catch((err) => {
console.error(err)
})