We help IT Professionals succeed at work.

how to use navigation timing API

I am loading data from SQL server DB into a ext js grid. However though i only have 40k records paging is getting very slow. how to check the amount of time its taking to each time it requests data. can i use navigation timing API for that? if yes how?

are there any possible ways to find out how much time each page is taking to load.

Thanks for your time.
Watch Question

Try this.

Measuring Page load performance using the performance.timing object:

The PerformanceTiming interface includes several attributes and one of them is the navigationStart attribute. This attribute returns the time when the browser attempts to fetch a new resource from the server. If there is a document from which the user is navigating to a new document (by clicking a link), then it returns time when the browser finishes unloading the previous document:

var startTime = new Date().getTime(); 

function onLoadEventHandler() { 

var latency = startTime - performance.timing.navigationStart; 

console.log('Latency = ' + latency + 'ms'); 


Open in new window