0

Lets say I have 2 different code snippets that do the same thing, and I want to measure which one of those took more time to execute. Example:


function log(text) {
    console.log(text);
}

log("Hello World");

and

console.log("Hello World");

is there a measurable difference between those 2?

Nuro007
  • 157
  • 12

1 Answers1

0

You can search about benchmarks, look that with your code: https://jsbench.me/6ol6b8gv88/1

Or here https://jsben.ch/JKZto

Or you can take a look in this question How to measure time taken by a function to execute

coheia
  • 18
  • 2