From 6ded0ed5c0dd3071b76335d416c57a76f42241d9 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 9 Apr 2025 09:24:27 -0400 Subject: [PATCH] feat(trace.subscriber): depopt on unix for timestamps --- src/subscriber/dune | 1 + src/subscriber/time_.unix.ml | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 src/subscriber/time_.unix.ml diff --git a/src/subscriber/dune b/src/subscriber/dune index 657c53f..30c53d6 100644 --- a/src/subscriber/dune +++ b/src/subscriber/dune @@ -9,5 +9,6 @@ (select time_.ml from (mtime mtime.clock.os -> time_.mtime.ml) (mtime mtime.clock.jsoo -> time_.mtime.ml) + (unix -> time_.unix.ml) ( -> time_.dummy.ml)))) diff --git a/src/subscriber/time_.unix.ml b/src/subscriber/time_.unix.ml new file mode 100644 index 0000000..b2683ff --- /dev/null +++ b/src/subscriber/time_.unix.ml @@ -0,0 +1,3 @@ +let[@inline] get_time_ns () : float = + let t = Unix.gettimeofday () in + t *. 1e9