Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 1 addition & 49 deletions modules/course/examples/bar.occ
Original file line number Diff line number Diff line change
Expand Up @@ -20,55 +20,7 @@
--

#INCLUDE "course.module"
--#INCLUDE "time.module"

--{{{ FUNCTION seconds
--* Convert seconds to timer ticks.
-- @param s Time in seconds
-- @return Time in timer ticks
INT INLINE FUNCTION seconds (VAL INT s)
INT ticks:
VALOF
#IF TARGET.BITS.PER.WORD = 16
ticks := s * 1000
#ELSE
ticks := s * 1000000
#ENDIF
RESULT ticks
:
--}}}

--{{{ FUNCTION milliseconds
--* Convert milliseconds to timer ticks.
-- @param ms Time in milliseconds
-- @return Time in timer ticks
INT INLINE FUNCTION milliseconds (VAL INT ms)
INT ticks:
VALOF
#IF TARGET.BITS.PER.WORD = 16
ticks := ms
#ELSE
ticks := ms * 1000
#ENDIF
RESULT ticks
:
--}}}

--{{{ FUNCTION microseconds
--* Convert microseconds to timer ticks.
-- @param us Time in microseconds
-- @return Time in timer ticks
INT INLINE FUNCTION microseconds (VAL INT us)
INT ticks:
VALOF
#IF TARGET.BITS.PER.WORD = 16
ticks := us / 1000
#ELSE
ticks := us
#ENDIF
RESULT ticks
:
--}}}
#INCLUDE "time.module"

--{{{ O.REQ protocol
PROTOCOL O.REQ
Expand Down