This is a very basic example of how to collect performance data on page load times. Read the full article on how to measure performance with JavaScript on mobile
In my article you will also find references to other useful resources about performance measurement for the Web.