0

I am a new user of asp and i was looking for a piece of code to test my page response time. Is there any way to have a browser timer in order to know the exact time when a page finished to load and be displayed (for instance when refresh)? A kind of google timeline but in a more simple way. Thanks for your help

Paul
  • 4,160
  • 3
  • 30
  • 56
WilliamW
  • 438
  • 7
  • 18

2 Answers2

2

You can take a hidden label and assign the page load time to it bu using Jquery easily.

$(function () {
    var beforeload = new Date().getTime();
    window.onload = gettimeload;
    function gettimeload() {
    var aftrload = new Date().getTime();
    // Time calculating in seconds
    time = (aftrload - beforeload) / 1000
    $("#lbltxt").text(time);
too_cool
  • 1,164
  • 8
  • 24
  • thanks for your answer, so now I have the loading time. Do you have any idea of how can i get some more details such as rendering time ? Maybe I should look on google before. But if you have any idea to help it will be great. – WilliamW Jul 03 '15 at 09:59
  • @WilliamW IF u want to see all details i will recommend you to use tools like Firebug..So you can explore a lot.Its a great tool :) and my ans helps plz mark it as ans..For the sake off reputation,,,, :P – too_cool Jul 03 '15 at 10:13
  • I will have a look of everything you gave me. Thanks for your fast answer ;) – WilliamW Jul 03 '15 at 10:14
0

This stack question provides some useful answers on this topic, particularly the 2nd answer.

Calculating Page Load Time In JavaScript

Community
  • 1
  • 1
ksb
  • 1