RosettaCodeData/Task/Sleep/Fantom/sleep.fantom

22 lines
332 B
Plaintext

using concurrent
class Main
{
public static Void main ()
{
echo ("Enter a time to sleep: ")
input := Env.cur.in.readLine
try
{
time := Duration.fromStr (input)
echo ("sleeping ...")
Actor.sleep (time)
echo ("awake!")
}
catch
{
echo ("Invalid time entered")
}
}
}