Skip to content

Commit e68cda7

Browse files
committed
Use Mtime.Span.to_float_ns instead of Mtime.Span.to_uint64_ns+Int64.to_float
Minor code reduction. Signed-off-by: Frediano Ziglio <[email protected]>
1 parent dc565fd commit e68cda7

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)