0

Code

console.time();
// ---
console.timeEnd();

// output
default: 72.081ms

Here, what is ms? is it microseconds or milliseconds?

I didn't get anything from here https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd

2
  • 1
    Microseconds would generally be abbreviated μs so this is milliseconds. Commented Dec 6, 2021 at 6:58
  • Please take a look into timer-table Commented Dec 6, 2021 at 6:58

1 Answer 1

2

ms means milliseconds.

console.time() -> starts a timer

console.timeEnd() -> ends a timer.

  • By using them together you can measure how long does it take to perform an operation.

E.g.

console.time();
for (i = 0; i < 100000; i++) {
  // long time process
}
console.timeEnd();
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.