Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 513 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 513 Bytes

timer

A simple timer for OCaml

Install

opam pin add timer https://github.com/skcho/timer.git

Example

let foo x =
  Timer.start "a"; (* Timer "a" starts. *)
  ...
  Timer.start "b"; (* Timer "a" stops. Time of "a" is accumulated.
                      Timer "b" starts. *)
  ...
  Timer.stop ()    (* Timer "b" stops. Time of "b" is accumulated. *)
in
List.iter foo l;
Timer.flush        (* All accumulated times are printed. *)

See test for more examples.