Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Clock provides timing facility
Synopsis
- data Clock
- newClock :: MonadIO m => m Clock
- data Time
- getClockTime :: MonadIO m => Clock -> m Time
- newtype Milli = Milli Natural
- sleep :: MonadIO m => Milli -> m ()
- data WaitResult result
- = WaitCompleted result
- | WaitTimeout
- waitTransaction :: MonadIO m => Milli -> STM result -> m (STM (WaitResult result))
Documentation
Read time
The number of milli secondes since the clock started.
Instances
ToJSON Time # | |
Defined in Butler.Core.Clock | |
Enum Time # | |
Num Time # | |
Integral Time # | |
Real Time # | |
Defined in Butler.Core.Clock toRational :: Time -> Rational # | |
Show Time # | |
Eq Time # | |
Ord Time # | |
ToHtml Time # | |
Serialise Time # | |
From Time Milli # | |
Defined in Butler.Core.Clock | |
From Time ByteString # | |
Defined in Butler.Core.Clock from :: Time -> ByteString # | |
From Time Text # | |
Defined in Butler.Core.Clock | |
From Time Natural # | |
Defined in Butler.Core.Clock | |
From Natural Time # | |
Defined in Butler.Core.Clock |
getClockTime :: MonadIO m => Clock -> m Time #
Duration
A duration in millisecond
stm helpers
data WaitResult result #
WaitCompleted result | |
WaitTimeout |
Instances
ToJSON result => ToJSON (WaitResult result) # | |
Defined in Butler.Core.Clock toJSON :: WaitResult result -> Value # toEncoding :: WaitResult result -> Encoding # toJSONList :: [WaitResult result] -> Value # toEncodingList :: [WaitResult result] -> Encoding # | |
Show result => Show (WaitResult result) # | |
Defined in Butler.Core.Clock showsPrec :: Int -> WaitResult result -> ShowS # show :: WaitResult result -> String # showList :: [WaitResult result] -> ShowS # |
waitTransaction :: MonadIO m => Milli -> STM result -> m (STM (WaitResult result)) #
Wait for a transaction with a timeout.