Get #Amazon #Prime for this #holiday #amazonprime #christmas #2019

#JavaScript - and console.time()

You can use console.time() or to check the time needed to run a block of code or fetch data from a server. From the examples below, you can notice that returns a more precise value which is of  DOMHighResTimeStamp type. It is accurate to 5 microseconds.

console time

You can replace the fetch block with the block of code that you want to measure such as processing JSON data. 


console.time('fetching ip info');
  .then(data => data.json())
  .then(data =>  {
console.timeEnd('fetching ip info');

var t0 =;
  .then(data => data.json())
  .then(data =>  {
var t1 =;
console.log("Call to fetch ip info took " + (t1 - t0) + "milliseconds.");

Performance now

Google Chrome Network Analysis

For a network request, you can use network analysis function on Chrome to analyze the traffic. You can read more about network analysis on Google Network Analysis document

Network Analysis
Chrome Network Analysis

Thank you for reading!