Skip to content

Commit

Permalink
Update for new mtime 2.x
Browse files Browse the repository at this point in the history
Signed-off-by: Dmtrii.Kosarev <[email protected]>
  • Loading branch information
Kakadu committed Mar 26, 2024
1 parent 8476f23 commit 2eb80e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OCanren.opam
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ depends: [
"benchmark" {with-test}
"ocamlformat" {with-test & >= "0.26.1" & < "0.27"}
"ppx_inline_test"
"mtime" {< "2.0.0"}
"mtime" {>= "2.0.0"}
"odoc" {with-doc}
]
build: [
Expand Down
5 changes: 4 additions & 1 deletion add_timer/install_timer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ module Impl : T = struct
let elapsed = Mtime_clock.elapsed
let abs_diff start fin =
let span = Mtime.Span.abs_diff start fin in
Mtime.Span.({s = to_s span; ms = to_ms span})
let ns = Mtime.Span.to_float_ns span in
let ms = ns *. 1000000.0 in
let s = ms *. 1000.0 in
{s; ms }

end

Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
(< 0.27)))
ppx_inline_test
(mtime
(< 2.0.0)))
(>= 2.0.0)))
(authors
"Dmitrii Boulytchev https://github.com/dboulytchev"
"Dmitrii Kosarev https://github.com/Kakadu"
Expand Down

0 comments on commit 2eb80e2

Please sign in to comment.