8.7.Β Timing

πŸ”—def
IO.sleep (ms : UInt32) : BaseIO Unit
πŸ”—opaque
IO.monoNanosNow : BaseIO Nat

Monotonically increasing time since an unspecified past point in nanoseconds. No relation to wall clock time.

πŸ”—opaque
IO.monoMsNow : BaseIO Nat

Monotonically increasing time since an unspecified past point in milliseconds. No relation to wall clock time.

πŸ”—opaque
IO.getNumHeartbeats : BaseIO Nat

Helper method for implementing "deterministic" timeouts. It is the number of "small" memory allocations performed by the current execution thread.

πŸ”—opaque
IO.addHeartbeats (count : UInt64) : BaseIO Unit

Adjusts the heartbeat counter of the current thread by the given amount. This can be useful to give allocation-avoiding code additional "weight" and is also used to adjust the counter after resuming from a snapshot.