问题
Unix.time()
returns seconds.
How can I get the time in ms or ns?
Thanks
回答1:
Try Unix.gettimeofday
# Unix.time ();;
- : float = 1447865942.
# Unix.gettimeofday();;
- : float = 1447865947.56802297
回答2:
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
来源:https://stackoverflow.com/questions/33785791/how-can-i-get-the-current-system-time-in-milliseconds-or-nanosec