Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Friday, 20 November 2015

Calculate loading time of page using javscript

Introduction:

          I am going to explain here how to calculate  page loading time using javascript with help of time function.

Explanation:

Here i calculated before loading and after loading time of page then i reduced time from after loading to before loading,here i used "(new Date()).getTime() " function for calculating time.

I hope you  understand from below code:

Calculate before lading time:

beforeload = (new Date()).getTime();

Calculate after loading time:

afterload = (new Date()).getTime();