Safe Haskell | Safe-Inferred |
---|
Synopsis
- start :: IO.IO () -> IO.IO Concurrent.ThreadId
- startLogged :: String -> IO.IO () -> IO.IO Concurrent.ThreadId
- asyncLogged :: String -> IO.IO a -> IO.IO (Async.Async a)
- type Seconds = NominalDiffTime
- delay :: Seconds -> IO.IO ()
- timeout :: Seconds -> IO.IO a -> IO.IO (Maybe a)
- data Flag
- flag :: IO.IO Flag
- set :: Flag -> IO.IO ()
- wait :: Flag -> IO.IO ()
- poll :: Seconds -> Flag -> IO.IO Bool
- force :: DeepSeq.NFData a => a -> IO.IO ()
- timeAction :: MonadIO m => m a -> m (a, Metric Seconds)
- timeActionText :: MonadIO m => m a -> m (a, Text)
- printTimer :: Text -> (a -> String) -> IO.IO a -> IO.IO a
- printTimer_ :: MonadIO m => Text -> m a -> m a
- printTimerVal :: (DeepSeq.NFData a, MonadIO m) => Text -> a -> m a
- currentCpu :: IO.IO Seconds
- forCpu_ :: [a] -> (a -> IO.IO b) -> IO.IO ()
- data Metric time = Metric {
- metricCpu :: Seconds
- metricWall :: time
- metric :: IO.IO (Metric UTCTime)
- diffMetric :: Metric UTCTime -> Metric UTCTime -> Metric Seconds
- showMetric :: Metric Seconds -> Text
Documentation
startLogged :: String -> IO.IO () -> IO.IO Concurrent.ThreadId Source #
Start a noisy thread that will log when it starts and stops, and warn if it dies from an exception.
asyncLogged :: String -> IO.IO a -> IO.IO (Async.Async a) Source #
type Seconds = NominalDiffTime Source #
This is just NominalDiffTime, but with a name I might remember.
Flag
A Flag starts False, and can eventually become True. It never goes back to False again.
poll :: Seconds -> Flag -> IO.IO Bool Source #
Wait a finite amount of time for the flag to become true.
timing
force :: DeepSeq.NFData a => a -> IO.IO () Source #
timeAction :: MonadIO m => m a -> m (a, Metric Seconds) Source #
Time an IO action in CPU and wall seconds. Technically not thread related, but I don't have a better place at the moment.
timeActionText :: MonadIO m => m a -> m (a, Text) Source #
Like timeAction
, but return a Text msg instead of the values.
printTimer_ :: MonadIO m => Text -> m a -> m a Source #
printTimerVal :: (DeepSeq.NFData a, MonadIO m) => Text -> a -> m a Source #
map concurrent
Metric
Metric | |
|