Task

Write a program that does the following in this order:

 Input an amount of time to sleep in whatever units are most natural for your language (milliseconds, seconds, ticks, etc.). This unit should be noted in comments or in a description.
 Print "Sleeping..."
 Sleep the main thread for the given amount of time.
 Print "Awake!"
 End.


Related task

   Nautical bell


BYTE RTCLOK1=$13
BYTE RTCLOK2=$14
BYTE PALNTSC=$D014
 
PROC Wait(CARD frames)
  BYTE lsb=frames,msb=frames+1
 
  ;wait lsb of frames
  lsb==+RTCLOK2
  WHILE lsb#RTCLOK2 DO OD
 
  ;wait msb of 256*frames
  WHILE msb>0
  DO
    WHILE lsb=RTCLOK2 DO OD
    WHILE lsb#RTCLOK2 DO OD
    msb==-1
  OD
RETURN
 
CARD FUNC GetFrame()
  CARD res
  BYTE lsb=res,msb=res+1
 
  lsb=RTCLOK2
  msb=RTCLOK1
RETURN (res)
 
CARD FUNC MsToFrames(CARD ms)
  CARD res
 
  IF PALNTSC=15 THEN
    res=ms/60
  ELSE
    res=ms/50
  FI
RETURN (res)
 
CARD FUNC FramesToMs(CARD frames)
  CARD res
 
  IF PALNTSC=15 THEN
    res=frames*60
  ELSE
    res=frames*50
  FI
RETURN (res)
 
PROC Main()
  CARD ARRAY data=[1 5 10 50 100 500]
  CARD beg,end,diff,diffMs,delay,delayMs
  BYTE i
 
  FOR i=0 TO 5
  DO
    delay=data(i)
    delayMs=FramesToMs(delay)
    PrintF("Wait %U frames / %U ms...%E",delay,delayMs)
 
    beg=GetFrame()
    Wait(delay)
    end=GetFrame()
    diff=end-beg
    diffMs=FramesToMs(diff)
 
    PrintF("Frame number at begin %U%E",beg)
    PrintF("Frame number at end %U%E",end)
    PrintF("Waited %U-%U=%U frames / %U ms%E%E",end,beg,diff,diffMs)
  OD
RETURN