From 08d33095f66c11475f6a07374f4113134e1cd4bd Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 20 Mar 2013 18:06:50 +0100 Subject: [PATCH] Future.sleep should take a float --- future.ml | 2 +- future.mli | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/future.ml b/future.ml index e964ddea..32a54441 100644 --- a/future.ml +++ b/future.ml @@ -510,7 +510,7 @@ let spawn_process ?(pool=default_pool) ?(stdin="") ~cmd = let sleep ?(pool=default_pool) time = spawn ~pool - (fun () -> Unix.sleep time; ()) + (fun () -> Thread.delay time; ()) module Infix = struct let (>>=) x f = flatMap f x diff --git a/future.mli b/future.mli index 24a3d1af..a1ce32cd 100644 --- a/future.mli +++ b/future.mli @@ -139,7 +139,7 @@ val spawn_process : ?pool:Pool.t -> ?stdin:string -> cmd:string -> (** Spawn a sub-process with the given command [cmd] (and possibly input); returns a future containing (returncode, stdout, stderr) *) -val sleep : ?pool:Pool.t -> int -> unit t +val sleep : ?pool:Pool.t -> float -> unit t (** Future that returns with success in the given amount of seconds *) module Infix : sig