Implement a basic cache dumper
[khatus.git] / src / ocaml / lib / khatus_time.ml
diff --git a/src/ocaml/lib/khatus_time.ml b/src/ocaml/lib/khatus_time.ml
new file mode 100644 (file)
index 0000000..cf6538a
--- /dev/null
@@ -0,0 +1,24 @@
+module Span = struct
+  type t = float
+
+  let of_string s =
+    float_of_string s
+
+  let is_gt_or_eq t1 t2 =
+    t1 >= t2
+end
+
+type t = float
+
+let init = 0.0
+
+let diff t0 t1 =
+  t1 -. t0
+
+let to_string t =
+  Printf.sprintf "%f" t
+  |> String.split_on_char '.'
+  |> List.hd
+
+let of_string s =
+  float_of_string s
This page took 0.023946 seconds and 4 git commands to generate.