title: How to check if X seconds has passed in Java?
body: <p>I know in <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="nofollow">.NET</a> I can do this:</p>
  
  <pre><code>DateTime test = DateTime.Now;
  if (test &gt;= (pastTime + TimeSpan.FromSeconds(15)) {
      doSomething();
  }
  </code></pre>
  
  <p>What is the Java equivalent?</p>