Reputation: 25812
Unix.time()
returns seconds.
How can I get the time in ms or ns?
Thanks
Upvotes: 4
Views: 3196
Reputation: 3030
Core has very robust time related functions, and since 112.06.00 there is a Time_ns
module.
utop # Time_ns.now();;
- : Time_ns.t = 2015-11-18 14:49:08.580109-05:00
Upvotes: 4
Reputation: 66818
Try Unix.gettimeofday
# Unix.time ();;
- : float = 1447865942.
# Unix.gettimeofday();;
- : float = 1447865947.56802297
Upvotes: 18