If f does terminate within to milliseconds returns its result. If not
throw a TimeOutException. If f throws an exception it is propagated to
the caller of withTimeout.
Use this as follows:
try { withTimeout( 1234 ) {
... your code ...
} } catch {
case e: TimeOutException ...
case ... other exception
}
runs f with timeout to
If f does terminate within to milliseconds returns its result. If not throw a TimeOutException. If f throws an exception it is propagated to the caller of withTimeout.
Use this as follows: try { withTimeout( 1234 ) { ... your code ... } } catch { case e: TimeOutException ... case ... other exception }