Module OgamlUtils.Clock

Simple clocks and counters

Small utility to make clocks and counters (ex. FPS counter)

type t
Type of a clock
val create : unit -> t
Creates a clock
val restart : t -> unit
Restarts a clock (sets the time origin and resets the tick counter to 0)
val tick : t -> unit
Increments the tick counter of a clock
val time : t -> float
Returns the elapsed time in seconds
val ticks : t -> int
Returns the number of ticks
val tps : t -> float
Returns the number of ticks per second
val spt : t -> float
Returns the average duration of a tick in seconds