import scala.concurrent._ import scala.concurrent.ExecutionContext.Implicits.global def printSlow(name: String): String = { Thread.sleep(1000) // do nothing for 1 second name + " returned!" } def printFast(name: String): String = { name + " returned!" } Future{ printSlow("first!") } printFast("second!") // >>> "second! returned!"" // >>> "first! returned!"