Console Time | Table O Contents

A modern browser method to measure the approximate amount of time in milliseconds ms required to execute a block of code …

Note. The Flammarion Logo Badge in the page header above is an .svg image file set to the dimensions of 5% width, auto height, and zoom. Go ahead and test the zoom-out feature by hovering over the badge to engage the expansion of the image.

Parameter Label

Hint. Both the console.time() and the complimentary console.timeEnd() methods accept one like parameter to fill each respective argument.

A value of the String type ie.) a label that identifies the test being run on the code block between the two methods, as follows:


console.time("checkpi");
// Declare three variables
var pia = 3.14159265359;
var pib = 3.14159265359;
var pic = "3.14159265359";
// An IFFE
(function() {
  var test = (pia == pib);
}());
console.timeEnd("checkpi");

Last Subtitle

More to come …


Note. The above synopsis was derived from an article written by Chad Adams [1].

  1. Mastering Javascript High Performance by Chad Adams. Published © 2015 by PACKTpub.com.

Support

Please support the co-workers who aggregate the Source Links for our projects.

Patreon

Like what you see in this project? If so, then support the authors and machine-elves who aggregate the source links and pages for our projects via Patreon.