RosettaCodeData/Task/Sleep/Fantom/sleep.fantom

22 lines
332 B
Text
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
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")
}
}
}