module type WATCHER =sig..end
WATCHER provides a base signature for watching nanosecond
precision clock ticks.
typespan_ns =int64
type trigger
type t
val watch : delay_ns:span_ns -> trigger -> twatch d tr is a tick in that occurs after d nanoseconds and is
watched by trigger tr.val unwatch : t -> unitunwatch w unwatches the tick in w. If w is no longer
Tick.WATCHER.waiting this has no effect. Otherwise w's trigger is guaranteed
not to be actuated and Tick.WATCHER.waiting w becomes false.val waiting : t -> bool
val linger_ns : t -> span_nslinger_ns w is the number of nanoseconds during which Tick.WATCHER.waiting w
was true. If w's trigger was actuated then:
linger_ns w < delay_ns w the tick was in advance.linger_ns w = delay_ns w the tick was on time.linger_ns w > delay_ns w the tick was late.val delay_ns : t -> span_nsdelay_ns w is w's waiting delay.val trigger : t -> triggertrigger w is w's trigger.val fold : ('a -> t -> 'a) -> 'a -> 'a