how to find time taken to load a page [closed]
How to get the time taken to load the current page.
Is that can we find how mu开发者_运维问答ch CPU memory utilization for that page to load..?
If you're looking for a javascript solution, you could sort of profile the time using the following script:
<script type="text/javascript">
(function ()
{
var startTime = new Date().getTime();
window.setTimeout(function()
{
var endTime = new Date().getTime();
alert("Page took " + (endTime - startTime) + "ms to load");
}, 0);
})();
</script>
If you are using Firefox, you can use extensions like Firebug, PageSpeed or YSlow - they will help you to analyze the page load time as well as the bottlenecks in the page load.
Download and install Firebug.
Right-click on the (bug) icon which has been placed at the bottom right of the Firefox window. Select 'enable all panels'. Then click on the 'Net' tab, and simply point your browser to the page you want to benchmark.
A simple google gave me a script on the first 3 results:
script
google search
I'm thinking you are looking for a javascript solution because you have the javascript tag selected.
精彩评论