83
A simple way to misure fetching time with console.time
2021-05-19 - JavaScript
1// JS Tip of the Day
2// A simple way to misure fetching time with console.time
3
4console.time('time2hero');
5fetch('https://myheroesapi.com/hero/1')
6.then(response => response.json())
7.then(json => {
8 console.timeEnd('time2hero') // time2hero: 83.51611328125 ms
9});
#JStipoftheday