Scala Duration API used for timeout