Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Sleep/Fantom/sleep.fantom
Normal file
21
Task/Sleep/Fantom/sleep.fantom
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue