aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/util.ml8
-rw-r--r--lib/util.mli5
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 6983410978..fb50d1e4e5 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -259,6 +259,14 @@ type ('a,'b) union = Inl of 'a | Inr of 'b
module Intset = Set.Make(struct type t = int let compare = compare end)
+type time_stamp = float
+
+let get_time_stamp () = Unix.time()
+
+let compare_time_stamps t1 t2 =
+ let dt = t2 -. t1 in
+ if dt < 0.0 then -1 else if dt = 0.0 then 0 else 1
+
(* Pretty-printing *)
let pr_spc () = [< 'sPC >];;
diff --git a/lib/util.mli b/lib/util.mli
index 2d764d4999..98296264f9 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -72,6 +72,11 @@ type ('a,'b) union = Inl of 'a | Inr of 'b
module Intset : Set.S with type elt = int
+type time_stamp
+
+val get_time_stamp : unit -> time_stamp
+val compare_time_stamps : time_stamp -> time_stamp -> int
+
(*s Pretty-printing. *)
val pr_spc : unit -> std_ppcmds