console.timeEnd()
Stops a named timer and logs the elapsed time.
Syntax
console.timeEnd(label)
Returns
undefined — Returns `undefined`.
Examples
console.time("task");
// ... work ...
console.timeEnd("task");
Output
task: 1.20ms
Notes
- The label must match the one passed to `console.time()`.
- Calling it for an unknown label produces a warning instead of a time.
- Use `console.timeLog()` to print intermediate elapsed times.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 2.0 |
| firefox | 10 |
| safari | 4 |
| edge | 12 |
| node | 0.10 |