Module type Timer.Timer

Abstraction to schedule and cancel timeout/alarm events for nodes in the simulation.

val set : int -> Simulator.Clock.t -> string -> unit

Creates and schedules a timeout event for a node.

  • parameter node_id

    the id of the node that is scheduling the timeout

  • parameter timestamp

    the timestamp when the timeout should occur

  • parameter label

    the label associated with the timout

val cancel : int -> Simulator.Events.timeout_label -> unit

Cancels an existing timeout event.

  • parameter node_id

    the id of the node whose timeout is getting canceled

  • parameter label

    the label of the respective timeout

val expired : int -> Simulator.Clock.t -> Simulator.Events.timeout_label -> bool

Checks if a given timeout is expired.

  • parameter node_id

    the id of the node

  • parameter timestamp

    the current timestamp

  • parameter label

    the label of the timeout whose expiration is being checked

val clear : unit -> unit

Clear all data associated with existing timers.