Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype TimeDelta = TimeDelta {}
- timeDeltaFromFracSecs :: (Real a, Show a) => a -> TimeDelta
- timeDeltaFromNanos :: (Integral a, Show a) => a -> TimeDelta
- timeDeltaToFracSecs :: Fractional a => TimeDelta -> a
- timeDeltaToNanos :: TimeDelta -> Word64
- diffTimeDelta :: TimeDelta -> TimeDelta -> Maybe TimeDelta
- threadDelayDelta :: TimeDelta -> IO ()
- class Ord t => TimeLike t where
- awaitDelta :: TimeLike t => t -> TimeDelta -> IO t
- newtype PosixTime = PosixTime {}
- 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
- assertingNonNegative :: (HasCallStack, Ord a, Num a, Show a) => a -> a
Documentation
Non-negative time difference in nanoseconds since last event
Like a Nano
(`Fixed E9`) but a machine word.
timeDeltaFromFracSecs :: (Real a, Show 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, Show 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 #
timeDeltaToNanos :: TimeDelta -> Word64 Source #
:: TimeDelta | the "larger" delta |
-> TimeDelta | the "smaller" delta |
-> Maybe TimeDelta | difference between the two (Nothing if negative) |
Return the difference of two time deltas
threadDelayDelta :: TimeDelta -> IO () Source #
class Ord t => TimeLike t where Source #
diffTime :: t -> t -> Maybe TimeDelta Source #
addTime :: t -> TimeDelta -> t Source #
currentTime :: IO t Source #
Monotonic time in nanoseconds since some unspecified epoch (see getMonotonicTimeNs
)
monoTimeToFracSecs :: Fractional a => MonoTime -> a Source #
monoTimeToNanos :: MonoTime -> Word64 Source #
posixToNtp :: PosixTime -> NtpTime Source #
ntpToPosix :: NtpTime -> PosixTime Source #
assertingNonNegative :: (HasCallStack, Ord a, Num a, Show a) => a -> a Source #