diff options
| author | Lasse Blaauwbroek | 2020-11-22 11:22:52 +0100 |
|---|---|---|
| committer | Lasse Blaauwbroek | 2020-12-06 16:56:07 +0100 |
| commit | 00a09f2cc4a8f4b6baeca0a474e5ab4062ff0f97 (patch) | |
| tree | 63884d6459014a889739ee9583ceb7d8d9d648e9 /lib/control.mli | |
| parent | 7514bc25c6e8dffeb58ae9af0916dac83953d337 (diff) | |
Add support for high resolution timeout functions.
Diffstat (limited to 'lib/control.mli')
| -rw-r--r-- | lib/control.mli | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/control.mli b/lib/control.mli index 9465d8f0d5..f992d8e8d0 100644 --- a/lib/control.mli +++ b/lib/control.mli @@ -24,13 +24,13 @@ val check_for_interrupt : unit -> unit (** Use this function as a potential yield function. If {!interrupt} has been set, il will raise [Sys.Break]. *) -val timeout : int -> ('a -> 'b) -> 'a -> 'b option +val timeout : float -> ('a -> 'b) -> 'a -> 'b option (** [timeout n f x] tries to compute [Some (f x)], and if it fails to do so before [n] seconds, returns [None] instead. *) (** Set a particular timeout function; warning, this is an internal API and it is scheduled to go away. *) -type timeout = { timeout : 'a 'b. int -> ('a -> 'b) -> 'a -> 'b option } +type timeout = { timeout : 'a 'b. float -> ('a -> 'b) -> 'a -> 'b option } val set_timeout : timeout -> unit (** [protect_sigalrm f x] computes [f x], but if SIGALRM is received during that |
