RosettaCodeData/Task/Sleep/Fantom/sleep.fantom
2023-07-01 13:44:08 -04:00

21 lines
332 B
Text

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")
}
}
}