From 40a743badb70f29ca47007eb4e394afdf1ff006d Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 23 Feb 2023 21:01:38 -0500 Subject: [PATCH] update to handle mtime 2.0 --- dune-project | 3 ++- sidekick.opam | 6 +++++- src/tef/Sidekick_tef.real.ml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dune-project b/dune-project index 8637eef0..1ab4d8ff 100644 --- a/dune-project +++ b/dune-project @@ -33,7 +33,8 @@ (alcotest :with-test) (odoc :with-doc)) (depopts - mtime ; for profiling stuff + (mtime + (>= 2.0)) ; for profiling stuff memtrace ; memory profiling zarith ; for arith ) diff --git a/sidekick.opam b/sidekick.opam index c82c4a08..671080eb 100644 --- a/sidekick.opam +++ b/sidekick.opam @@ -16,7 +16,11 @@ depends: [ "alcotest" {with-test} "odoc" {with-doc} ] -depopts: ["mtime" "memtrace" "zarith"] +depopts: [ + "mtime" {>= "2.0"} + "memtrace" + "zarith" +] conflicts: [ "zarith" {< "1.8"} ] diff --git a/src/tef/Sidekick_tef.real.ml b/src/tef/Sidekick_tef.real.ml index e025ca10..61e698f8 100644 --- a/src/tef/Sidekick_tef.real.ml +++ b/src/tef/Sidekick_tef.real.ml @@ -31,7 +31,7 @@ module Make () : P.BACKEND = struct let get_ts () : float = let now = Mtime_clock.now () in - Mtime.Span.to_us (Mtime.span program_start now) + Mtime.Span.to_float_ns (Mtime.span program_start now) /. 1e3 let emit_sep_ () = if !first_ then