
13 Nov
2006
13 Nov
'06
9:29 p.m.
Peter Simons writes:
data TimeoutError = TimeoutError deriving (Show, Typeable) type Microseconds = Int
timeout :: Microseconds -> IO a -> IO a
This seems like a good place to use DiffTime, from Data.Time.Clock. That
way, you can specify timeouts using (fractional) seconds and avoid
confusion as to whether timeout uses microseconds, milliseconds, or
nanoseconds.
Unforunately, Data.Time.Clock is in the time package. An alternative is
Micro, from Data.Fixed.
--
David Menendez