Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
Documentation
This is a length of time, as measured by a clock.
Conversion functions such as fromInteger
and realToFrac
will treat it as seconds.
For example, (0.010 :: DiffTime)
corresponds to 10 milliseconds.
It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.
Instances
FromJSON DiffTime | This instance includes a bounds check to prevent maliciously
large inputs to fill up the memory of the target system. You can
newtype |
ToJSON DiffTime | |
Data DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DiffTime -> c DiffTime # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DiffTime # toConstr :: DiffTime -> Constr # dataTypeOf :: DiffTime -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DiffTime) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DiffTime) # gmapT :: (forall b. Data b => b -> b) -> DiffTime -> DiffTime # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r # gmapQ :: (forall d. Data d => d -> u) -> DiffTime -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> DiffTime -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime # | |
Enum DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime | |
Num DiffTime | |
Read DiffTime | |
Fractional DiffTime | |
Real DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime toRational :: DiffTime -> Rational # | |
RealFrac DiffTime | |
Show DiffTime | |
NFData DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime | |
Eq DiffTime | |
Ord DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime |
secondsToDiffTime :: Integer -> DiffTime #
Create a DiffTime
which represents an integral number of seconds.
picosecondsToDiffTime :: Integer -> DiffTime #
Create a DiffTime
from a number of picoseconds.
diffTimeToFullMicroseconds :: DiffTime -> Int Source #
Rounds down. Useful for threadDelay
, timeout
, etc.
diffTimeToPicoseconds :: DiffTime -> Integer #
Get the number of picoseconds in a DiffTime
.