Webpage redirection time

9 views
Skip to first unread message

Abhijeet Muneshwar

unread,
Dec 2, 2012, 5:23:04 AM12/2/12
to javasc...@googlegroups.com
Hi all,

I want to calculate time consumed in redirecting from 1 webpage to another webpage.
For Example:
1) I am using Facebook in Google Chrome browser.
I have shared 1 link on my Facebook profile like below:

(It's not only Facebook. It can be any domain having link to another domain).


2) When I click on this link from my Facebook profile, then this website will open in new tab.

3) I want to calculate time difference in miliseconds or microseconds between below two events:
First Event: Time of clicking link "http://www.webdeveloper.com/" from my Facebook profile.
Second Event: Time of completely loading webpage of "http://www.webdeveloper.com/".

Thank you in advance.

JavaScript MN

unread,
Dec 2, 2012, 8:28:28 AM12/2/12
to javasc...@googlegroups.com

If you don't need to support it in all/old browsers, you should check out the relatively new Navigation Timing API:
    https://developer.mozilla.org/en-US/docs/Navigation_timing

Straight from the examples:

Calculate the total time required to load a page:
var perfData = window.performance.timing;
var pageLoadTime = perfData.loadEventEnd – perfData.navigationStart;

~~James

Abhijeet Ashok Muneshwar

unread,
Dec 3, 2012, 3:15:45 AM12/3/12
to javasc...@googlegroups.com
Thank you for your responses.
I decided to go ahead with firebug for Firefox and Developer Tools for Chrome.
My problem is solved.

Thank you & Regards,
Abhijeet Ashok Muneshwar
M. Tech (Computer Science & Engineering) (2nd year)
National Institute of Technology, Karnataka. India.

Reply all
Reply to author
Forward
0 new messages