How do I round console.time logs?

  console, execution, javascript, timer

When I use console.time and console.timeEnd to measure the execution speed of a function or code snippet in JavaScript it prints this to the console:

timer: 14657.580078125 ms

How do I round this to the nearest integer or some other digit? I’ve looked at the documentation for both of these functions and neither gives me a clue how to do this.

Source: Ask Javascript Questions

LEAVE A COMMENT