# How to know the exact time to load a page using Selenium WebDriver?

We can determine the exact time to load a page using Selenium webdriver. We can capture the time before the page load with help of the System.currentTimeMillis method.

After the URL for the application is launched, we have to wait for the page to be loaded completely with the help of the explicit wait condition. Once the expected criteria for the element is met, we shall again record the current time.

The difference between the time recorded prior and post the page load will measure the exact time to load a page.

## Syntax

long s = System.currentTimeMillis();

## Example

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver",
"C:\Users\ghs6kor\Desktop\Java\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
long s = System.currentTimeMillis();
//URL launch
driver.get("https://www.tutorialspoint.com/videotutorials/subscription.php");
WebDriverWait wt = new WebDriverWait(driver,6);
long e = System.currentTimeMillis();
//compute time
long r = e – s;
System.out.println("Page load time in milliseconds: " + r);
driver.close();
}
}