Skip to content

Instantly share code, notes, and snippets.

View 403-html's full-sized avatar
💫

Tymoteusz Stępień 403-html

💫
View GitHub Profile
// count time needed to execute a function
// precisition is 0.0001 ms
const countTime = (func) => {
const startTime = performance.now();
func();
const endTime = performance.now();
const timeNeeded = endTime - startTime;
console.log(`${func.name} needed ${timeNeeded.toFixed(4)} ms`);
}