You can use the below existing method to set the time for pageeLoadTimeout
in below example if the page is taking more than 20 seconds to load , then it will throw an exception of page reload
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS)