Something went wrong. Try again.
forked from gbury/dolmen
Something went wrong. Try again.
12345678910111213141516171819202122232425
(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
(* Simple timer *)(* ************************************************************************* *)
type t = { mutable start : float; (* start of the timer *)}
let start () = (* allocate the recors before calling gettimeofday to avoid counting the time of the record allocation in the timer. *) let t = { start = 0.; } in t.start <- Unix.gettimeofday (); t
let stop t = let stop = Unix.gettimeofday () in stop -. t.start