If you are trying to find out how much time does it take to load a page completely using Selenium WebDriver (a.k.a Selenium 2).
Normally WebDriver should return control to your code only after the page has loaded completely.
So the following Selenium Java code might help you to find the time for a page load -
long start = System.currentTimeMillis();
driver.get("Some url");
long finish = System.currentTimeMillis();
long totalTime = finish - start;
System.out.println("Total Time for page load - "+totalTime);
If this does not work then you will have to wait till some element is displayed on the page -
long start = System.currentTimeMillis();
driver.get("Some url");
WebElement ele = driver.findElement(By.id("ID of some element on the page which will load"));
long finish = System.currentTimeMillis();
long totalTime = finish - start;
System.out.println("Total Time for page load - "+totalTime);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…