Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data Sign
- data TimeDelta = TimeDelta {}
- timeDeltaFromFracSecs :: Real a => a -> TimeDelta
- timeDeltaFromNanos :: Integral a => a -> TimeDelta
- timeDeltaToFracSecs :: Fractional a => TimeDelta -> a
- timeDeltaToNanos :: TimeDelta -> (Sign, Word64)
- threadDelayDelta :: TimeDelta -> IO ()
- showTimeDelta :: Int -> TimeDelta -> String
- class Ord t => TimeLike t where
- awaitDelta :: TimeLike t => t -> TimeDelta -> IO t
- newtype PosixTime = PosixTime {}
- showPosixTime :: PosixTime -> String
- newtype MonoTime = MonoTime {
- unMonoTime :: Word64
- monoTimeToFracSecs :: Fractional a => MonoTime -> a
- monoTimeToNanos :: MonoTime -> Word64
- monoTimeFromFracSecs :: (Real a, Show a) => a -> MonoTime
- monoTimeFromNanos :: (Integral a, Show a) => a -> MonoTime
- newtype NtpTime = NtpTime {}
- posixToNtp :: PosixTime -> NtpTime
- ntpToPosix :: NtpTime -> PosixTime
Documentation
Sign (negative or positive) of a magnitude of time difference
Signed time difference in nanoseconds since last event
Like a Nano
(`Fixed E9`) but using a machine word with explicit sign.
timeDeltaFromFracSecs :: Real a => a -> TimeDelta Source #
Return a TimeDelta
corresponding the the given number of fractional seconds.
(For example, 1.5 represents one and a half seconds.)
timeDeltaFromNanos :: Integral a => a -> TimeDelta Source #
Return a TimeDelta
corresponding the the given number of nanoseconds.
(For example, 1000000000 represends one second.)
timeDeltaToFracSecs :: Fractional a => TimeDelta -> a Source #
threadDelayDelta :: TimeDelta -> IO () Source #
showTimeDelta :: Int -> TimeDelta -> String Source #
Show a TimeDelta
as a fractional second with the given number
of decimal places for debugging
class Ord t => TimeLike t where Source #
diffTime :: t -> t -> TimeDelta Source #
`diffTime end start` computes `end - start`
addTime :: t -> TimeDelta -> t Source #
`addTime start (diffTime end start) == end`
currentTime :: IO t Source #
Get the current time in the desired type
Monotonic time in nanoseconds since some unspecified epoch (see getMonotonicTimeNs
)
monoTimeToFracSecs :: Fractional a => MonoTime -> a Source #
monoTimeToNanos :: MonoTime -> Word64 Source #