We can get the current time in milliseconds since the start of the year 1970 by writing this:
let t = new Date().getTime();
Do that at the start and end of some processing and get the elapsed time as the difference, dt
. Report that using console.log("Time taken: " + dt + "ms");
.