title: Scala - ScheduledFuture
body: <p>I am trying to implement scheduled future in Scala. I would like it to wait specific time and then execute the body. So far I tried the following, simple approach</p>
  
  <pre><code>val d = 5.seconds.fromNow
  
  val f = future {Await.ready(Promise().future, d.timeLeft); 1}
  
  val res = Await.result(f, Duration.Inf)
  </code></pre>
  
  <p>but I am getting the TimeoutExcpetion on the future. Is this even the correct approach or should I simply use the ScheduledExecutor from Java?</p>