aboutsummaryrefslogtreecommitdiff
path: root/ocaml/core.ml
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2015-01-30 12:38:32 -0500
committerChouser <chouser@n01se.net>2015-01-30 12:54:43 -0500
commitf5fc0c98ee9c140077469146bbc9d8a77fdb02f3 (patch)
tree698acd986d10a6227ad42a0eaf2671878f26a341 /ocaml/core.ml
parent2b8e0ea42046505635e8f4c9d96e594c595948c2 (diff)
downloadmal-f5fc0c98ee9c140077469146bbc9d8a77fdb02f3.tar.gz
mal-f5fc0c98ee9c140077469146bbc9d8a77fdb02f3.zip
OCaml: Add time-ms
Diffstat (limited to 'ocaml/core.ml')
-rw-r--r--ocaml/core.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/ocaml/core.ml b/ocaml/core.ml
index 6d7b014..20f68b6 100644
--- a/ocaml/core.ml
+++ b/ocaml/core.ml
@@ -197,4 +197,7 @@ let init env = begin
Env.set env (Types.symbol "swap!")
(Types.fn (function T.Atom x :: T.Fn { T.value = f } :: args
-> let v = f (!x :: args) in x := v; v | _ -> T.Nil));
+
+ Env.set env (Types.symbol "time-ms")
+ (Types.fn (function _ -> T.Int (truncate (1000.0 *. Unix.gettimeofday ()))));
end