Skip to content

Commit 96f7cd1

Browse files
authored
Use Mtime.Span.to_float_ns instead of Mtime.Span.to_uint64_ns+Int64.to_float (#6211)
Minor code reduction.
2 parents 53a081c + e68cda7 commit 96f7cd1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ocaml/libs/xapi-stdext/lib/xapi-stdext-threads/scheduler.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ let lock = Mutex.create ()
3636
module Clock = struct
3737
let span s = Mtime.Span.of_uint64_ns (Int64.of_float (s *. 1e9))
3838

39-
let span_to_s span =
40-
Mtime.Span.to_uint64_ns span |> Int64.to_float |> fun ns -> ns /. 1e9
39+
let span_to_s span = Mtime.Span.to_float_ns span |> fun ns -> ns /. 1e9
4140

4241
let add_span clock secs =
4342
(* return mix or max available value if the add overflows *)

0 commit comments

Comments
 (0)