module Ouroboros.Consensus.Util.Time (
multipleNominalDelay
, nominalDelay
, secondsToNominalDiffTime
) where
import Data.Time (DiffTime, NominalDiffTime)
multipleNominalDelay :: Integral a => NominalDiffTime -> a -> NominalDiffTime
multipleNominalDelay :: forall a. Integral a => NominalDiffTime -> a -> NominalDiffTime
multipleNominalDelay NominalDiffTime
dur a
i = NominalDiffTime
dur NominalDiffTime -> NominalDiffTime -> NominalDiffTime
forall a. Num a => a -> a -> a
* a -> NominalDiffTime
forall a b. (Integral a, Num b) => a -> b
fromIntegral a
i
nominalDelay :: NominalDiffTime -> DiffTime
nominalDelay :: NominalDiffTime -> DiffTime
nominalDelay = NominalDiffTime -> DiffTime
forall a b. (Real a, Fractional b) => a -> b
realToFrac
secondsToNominalDiffTime :: Double -> NominalDiffTime
secondsToNominalDiffTime :: Double -> NominalDiffTime
secondsToNominalDiffTime = Double -> NominalDiffTime
forall a b. (Real a, Fractional b) => a -> b
realToFrac