开发者

how to find time taken to load a page [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜