Join the DZone community and get the full member experience.Join For Free
Container Monitoring and Management eBook: Read about the new realities of containerization.
The msPerformance Object
How to Use msPerformance?
The msPerformance which is located under the window DOM object exposes three properties:
- navigation – a reference to MSPerformanceNavigation object, which holds navigation data.
- timing – a reference to MSPerformanceTiming object, which holds timing data.
- timingMeasures – a reference to MSPerformanceTimingMeasures object, which holds timing measures.
Those objects hold a lot of properties and information about the performance of the web page that is currently running. The following code example shows how to fill a table with some web page performance measurements:
In this simple page when the button is clicked I first check that the windows.msPerformance exists. Then I pull out some performance data and show it to the user. After pushing the button an example of the table that can be generated could be:
Pay attention that the performance data is available only after the page was loaded!
Published at DZone with permission of Gil Fink , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.