From 7eb1968b2ecbb6d2f82d36c9257604c57158729c Mon Sep 17 00:00:00 2001 From: Romain Beauxis Date: Sun, 4 Feb 2024 17:39:12 -0600 Subject: [PATCH] Revert "Safer timeout computation." This reverts commit 7f2f46402739df6e5c52b66974e6065aab5a5854. --- src/cry.ml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/cry.ml b/src/cry.ml index 98bb5bc..3eb81f5 100644 --- a/src/cry.ml +++ b/src/cry.ml @@ -25,12 +25,7 @@ let poll r w timeout = match timeout with | x when x < 0. -> Poll.Timeout.never | 0. -> Poll.Timeout.immediate - | x -> - let frac, int = modf x in - let int = Int64.mul (Int64.of_float int) 1_000_000_000L in - let frac = Int64.of_float (frac *. 1_000_000_000.) in - let timeout = Int64.add int frac in - Poll.Timeout.after timeout + | x -> Poll.Timeout.after (Int64.of_float (x *. 1_000_000_000.)) in let poll = Poll.create () in List.iter (fun fd -> Poll.set poll fd Poll.Event.read) r;