feat: improve benchmarking code
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m56s

This commit is contained in:
2024-05-02 00:00:18 +02:00
parent e085b4ba6b
commit e2b18370f1
2 changed files with 40 additions and 6 deletions

View File

@ -65,7 +65,7 @@ export function createNodePath({
export const debounce = (fn: Function, ms = 300) => {
let timeoutId: ReturnType<typeof setTimeout>;
return function (this: any, ...args: any[]) {
return function(this: any, ...args: any[]) {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => fn.apply(this, args), ms);
};
@ -126,3 +126,4 @@ export function humanizeNumber(number: number): string {
const rounded = Math.round(number / base * 10) / 10;
return rounded + suffixes[baseIndex];
}