utils
¶
| utils.assertEq() | Asserts that two expressions are equal to each other |
| utils.assertNe() | Asserts that two expressions are not equal to each other |
| utils.secs() | Converts seconds to nanoseconds |
| utils.millis() | Converts milliseconds to nanoseconds |
| utils.micros() | Converts microseconds to nanoseconds |
| utils.nanos() | Converts nanoseconds to nanoseconds |
Asserts that two expressions are equal to each other. Raises an error otherwise.
| lhs | (any) | Left value |
| rhs | (any) | Right value |
| msg | (string or nil) | Optional custom error message |
Asserts that two expressions are not equal to each other. Raises an error otherwise.
| lhs | (any) | Left value |
| rhs | (any) | Right value |
| msg | (string or nil) | Optional custom error message |
Converts seconds to nanoseconds. Useful for explicitly specifying MainLoopScheduler timer duration.
token = MainLoopScheduler.prependTimer(
MainLoopStage.USER,
"MyTimer",
TimerRecurrence.Recurring,
secs(5),
handler
)
| time | (number) | Seconds |
| (number) | Nanoseconds |
Converts milliseconds to nanoseconds. Useful for explicitly specifying MainLoopScheduler timer duration.
token = MainLoopScheduler.prependTimer(
MainLoopStage.USER,
"MyTimer",
TimerRecurrence.Recurring,
millis(5),
handler
)
| time | (number) | Milliseconds |
| (number) | Nanoseconds |
Converts microseconds to nanoseconds. Useful for explicitly specifying MainLoopScheduler timer duration.
token = MainLoopScheduler.prependTimer(
MainLoopStage.USER,
"MyTimer",
TimerRecurrence.Recurring,
micros(5),
handler
)
| time | (number) | Microseconds |
| (number) | Nanoseconds |
Converts nanoseconds to nanoseconds. Useful for explicitly specifying MainLoopScheduler timer duration.
token = MainLoopScheduler.prependTimer(
MainLoopStage.USER,
"MyTimer",
TimerRecurrence.Recurring,
nanos(5),
handler
)
| time | (number) | Nanoseconds |
| (number) | Nanoseconds |