From f5fc0c98ee9c140077469146bbc9d8a77fdb02f3 Mon Sep 17 00:00:00 2001 From: Chouser Date: Fri, 30 Jan 2015 12:38:32 -0500 Subject: OCaml: Add time-ms --- ocaml/core.ml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ocaml/core.ml') 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 -- cgit v1.2.3