title: Check page load time in Selenium
body: <p>I need to check if the page does not load more than n seconds. </p>
  
  <p>I using C# with Selenium and NUnit</p>
  
  <p>I've seen a few ways:</p>
  
  <p>1:</p>
  
  <pre class="lang-cs prettyprint-override"><code>var time1=DateTime.Now.Ticks/TimeSpan.TicksPerMillisecond;
  driver.Navigate().GoToUrl("http://football.ua");
  var time2=DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
  Console.WriteLine(time2-time1);
  
  //check difference
  </code></pre>
  
  <p>2:</p>
  
  <pre class="lang-cs prettyprint-override"><code>driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(10));          
  driver.Navigate().GoToUrl(---------);
  
  //If the load is greater than 10 seconds, takes exception
  //I doubt this method, since exceptions emerge, even if the place is quite large     timeout (10 sec)
  </code></pre>
  
  <p>3: Using Explicit Waits</p>
  
  <p>Example:</p>
  
  <pre class="lang-cs prettyprint-override"><code>IWebDriver driver = new FirefoxDriver();
  driver.Url = "http://football.ua";
  WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
  IWebElement myDynamicElement = wait.Until&lt;IWebElement&gt;((d) =&gt;
      {
      return d.FindElement(By.Id("someDynamicElement"));
      });
  </code></pre>
  
  <p>But I do not know how to anchor waiting to move on url.
  Tell me, what is better, or offer their own versions.</p>