Hi, I would like to implement a "timeout" function of type: float -> ('a -> 'b) -> 'a -> 'b option which takes a maximum number n of seconds to run, a function f, an argument x, and returns Some (f x) if the computation ends before n seconds and None otherwise. Of course, there is a simple implementation using Unix.setitimer, but apparently it does not work under windows because of signals implementation (and I don't have access to a windows machine...). Since this is a pretty standard idom I expected to find it implemented in some library, but could not find one. Also, I'd rather not heavily change the code (i.e. monadic threads are not really an option here, and a small function would be appreciated). Extra points if your solution also works with js_of_ocaml! :) Thanks! Regards, Samuel.