| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.BlockchainTime.WallClock.Types
Synopsis
- newtype SystemStart = SystemStart {}
- newtype RelativeTime = RelativeTime {}
- addRelTime :: NominalDiffTime -> RelativeTime -> RelativeTime
- diffRelTime :: RelativeTime -> RelativeTime -> NominalDiffTime
- toRelativeTime :: SystemStart -> UTCTime -> RelativeTime
- fromRelativeTime :: SystemStart -> RelativeTime -> UTCTime
- data SystemTime m = SystemTime {
- systemTimeCurrent :: m RelativeTime
- systemTimeWait :: m ()
- data SlotLength
- getSlotLength :: SlotLength -> NominalDiffTime
- mkSlotLength :: NominalDiffTime -> SlotLength
- slotLengthFromSec :: Integer -> SlotLength
- slotLengthToSec :: SlotLength -> Integer
- slotLengthFromMillisec :: Integer -> SlotLength
- slotLengthToMillisec :: SlotLength -> Integer
System time
newtype SystemStart Source #
System start
Slots are counted from the system start.
Constructors
| SystemStart | |
Fields | |
Instances
| Eq SystemStart Source # | |
| Show SystemStart Source # | |
Defined in Ouroboros.Consensus.BlockchainTime.WallClock.Types Methods showsPrec :: Int -> SystemStart -> ShowS # show :: SystemStart -> String # showList :: [SystemStart] -> ShowS # | |
| Generic SystemStart Source # | |
Defined in Ouroboros.Consensus.BlockchainTime.WallClock.Types Associated Types type Rep SystemStart :: Type -> Type # | |
| NoThunks SystemStart Source # | |
| type Rep SystemStart Source # | |
Defined in Ouroboros.Consensus.BlockchainTime.WallClock.Types type Rep SystemStart = D1 ('MetaData "SystemStart" "Ouroboros.Consensus.BlockchainTime.WallClock.Types" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'True) (C1 ('MetaCons "SystemStart" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSystemStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime))) | |
Relative time
newtype RelativeTime Source #
RelativeTime is time relative to the SystemStart
Constructors
| RelativeTime | |
Fields | |
Instances
addRelTime :: NominalDiffTime -> RelativeTime -> RelativeTime Source #
toRelativeTime :: SystemStart -> UTCTime -> RelativeTime Source #
fromRelativeTime :: SystemStart -> RelativeTime -> UTCTime Source #
Get current time (as RelativeTime)
data SystemTime m Source #
System time
Slots are counted from the system start.
Constructors
| SystemTime | |
Fields
| |
Instances
| NoThunks (SystemTime m) Source # | |
Slot length
data SlotLength Source #
Slot length
Instances
mkSlotLength :: NominalDiffTime -> SlotLength Source #
Constructor for SlotLength
Conversions
slotLengthToSec :: SlotLength -> Integer Source #