feat: improve benchmarking code
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m56s
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m56s
This commit is contained in:
@ -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];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user