summary refs log tree commit diff
path: root/source/xi_lib/measure.ml
diff options
context:
space:
mode:
authorPaweł Dybiec <pdybiec@stud.cs.uni.wroc.pl>2018-10-30 15:32:56 +0100
committerPaweł Dybiec <pdybiec@stud.cs.uni.wroc.pl>2018-10-30 15:32:56 +0100
commitb798ac29c37299b2f761243ae92ab8f7c4c4d7f1 (patch)
treeeb9b9cc9be294fe5bd3acf9a342098ffc0ea06e5 /source/xi_lib/measure.ml
Initial commit
Diffstat (limited to 'source/xi_lib/measure.ml')
-rw-r--r--source/xi_lib/measure.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/xi_lib/measure.ml b/source/xi_lib/measure.ml
new file mode 100644
index 0000000..1aec0b9
--- /dev/null
+++ b/source/xi_lib/measure.ml
@@ -0,0 +1,8 @@
+let logf fmt = Logger.make_logf __MODULE__ fmt
+
+let measure name f =
+  let t_start = Unix.gettimeofday () in 
+  let r = f () in
+  let t_end = Unix.gettimeofday () in
+  logf "%s: execution time %f" name (t_end -. t_start);
+  r
\ No newline at end of file