Say, you’ve added a few extender controls to make your AJAX-enabled web site look very ecstatically appealing to the end users. And now you’d like to evaluate the cost of beautifying your site in such manner. Measuring the additional page size bytes is pretty straight forward, so is the page load time… But how would you measure the time it takes for the browser to initialize these extra controls?
Here is the best way I know how:
var prm = Sys.WebForms.PageRequestManager.getInstance();
function pageLoadedHandler(sender, args)
t1 = new Date();
window.pageLoad = function()
alert("AJAX control initialization took " + ((new Date()).getTime() - t1.getTime()) + " ms");
Important: The logic above depends on the AJAX client side initialization implementation; i.e. the code above may or may not work in future AJAX releases.