Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

javascript

How to get the time taken to load the current page.

Is that can we find how much CPU memory utilization for that page to load..?

like image 248
Santhosh Avatar asked Feb 28 '23 16:02

Santhosh


2 Answers

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>
like image 100
Andy E Avatar answered Mar 02 '23 10:03

Andy E


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.

like image 42
Veera Avatar answered Mar 02 '23 10:03

Veera