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
Asked
Active
Viewed 431 times
0
-
use jquery and print the time in a hidden field.. and chk by view source.. – too_cool Jul 03 '15 at 09:40
-
If you are usng asp.net mvc, [MiniProfiler](http://miniprofiler.com/) is an excellent choice. – Hintham Jul 03 '15 at 09:43
-
you can use <%@ Page Trace="true" %> and check Trace details – Rohit Jul 03 '15 at 09:51
-
@Hintham, no i am not using asp.net mvc, just using the classic asp the "empty web application" – WilliamW Jul 03 '15 at 10:03
-
@kyle yes, i have tried with the trace, the problem is that it is server side i think so i can't have the total time -> the client one – WilliamW Jul 03 '15 at 10:05
2 Answers
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.