Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I get the total server AND client page load time?
    primarykey
    data
    text
    <p>I am measuring performance of an ASP.NET page. I need to measurement two parts: 1) The server page load time (to calculate the time it takes to bind controls from data loaded from database) and 2) measure the difference between the millisecond that the server's PageLoad event started and the millisecond that the client has finished loading (because I want to be able to calculate the time it took for the client browser to download and render the HTML).</p> <p>Measuring the serverside load time is easy with the StopWatch class. The part I need advice for is capturing the date and time that the client has loaded.</p> <p>Here's what I am doing in this order:</p> <ul> <li>As soon as server page load event runs, I write the current date and time to a hidden field.</li> <li>On the client, I use <code>$(document).ready()</code> to fire off an AJAX call to a WebMethod that returns the server's date and time.</li> <li>I then parse the dates and times from the date string stored in the hidden field and the date string returned from the Webmethod call and write their differences to a <code>span</code> element on the page.</li> </ul> <p>I do this so I can keep the client datetime in sync with the server datetime due to the fact that someone's machine time can easily be off by a few seconds. However, I think that AJAX call adds a little overhead itself which is counterproductive to performance measurement.</p> <p>Is there an accurate method of using GMT to sync up the client time with the server time without having to report to the server to get it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload