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
- fromRelativeTime ∷ SystemStart → RelativeTime → UTCTime
- toRelativeTime ∷ SystemStart → UTCTime → RelativeTime
- data SystemTime (m ∷ Type → Type) = SystemTime {
- systemTimeCurrent ∷ m RelativeTime
- systemTimeWait ∷ m ()
- getSlotLength ∷ SlotLength → NominalDiffTime
- mkSlotLength ∷ NominalDiffTime → SlotLength
- slotLengthFromMillisec ∷ Integer → SlotLength
- slotLengthFromSec ∷ Integer → SlotLength
- slotLengthToMillisec ∷ SlotLength → Integer
- slotLengthToSec ∷ SlotLength → Integer
- data SlotLength
System time
newtype SystemStart Source #
System start
Slots are counted from the system start.
Constructors
SystemStart | |
Fields |
Instances
Relative time
newtype RelativeTime Source #
RelativeTime
is time relative to the SystemStart
Precision is in picoseconds
Constructors
RelativeTime | |
Fields |
Instances
FromJSON RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods parseJSON ∷ Value → Parser RelativeTime Source # parseJSONList ∷ Value → Parser [RelativeTime] Source # | |||||
ToJSON RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods toJSON ∷ RelativeTime → Value Source # toEncoding ∷ RelativeTime → Encoding Source # toJSONList ∷ [RelativeTime] → Value Source # toEncodingList ∷ [RelativeTime] → Encoding Source # omitField ∷ RelativeTime → Bool Source # | |||||
FromCBOR RelativeTime | |||||
Defined in Cardano.Slotting.Time | |||||
ToCBOR RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods toCBOR ∷ RelativeTime → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy RelativeTime → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [RelativeTime] → Size Source # | |||||
Generic RelativeTime | |||||
Defined in Cardano.Slotting.Time Associated Types
| |||||
Show RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods showsPrec ∷ Int → RelativeTime → ShowS # show ∷ RelativeTime → String # showList ∷ [RelativeTime] → ShowS # | |||||
Eq RelativeTime | |||||
Defined in Cardano.Slotting.Time | |||||
Ord RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods compare ∷ RelativeTime → RelativeTime → Ordering # (<) ∷ RelativeTime → RelativeTime → Bool # (<=) ∷ RelativeTime → RelativeTime → Bool # (>) ∷ RelativeTime → RelativeTime → Bool # (>=) ∷ RelativeTime → RelativeTime → Bool # max ∷ RelativeTime → RelativeTime → RelativeTime # min ∷ RelativeTime → RelativeTime → RelativeTime # | |||||
NoThunks RelativeTime | |||||
Defined in Cardano.Slotting.Time | |||||
Serialise RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods encode ∷ RelativeTime → Encoding Source # decode ∷ Decoder s RelativeTime Source # encodeList ∷ [RelativeTime] → Encoding Source # decodeList ∷ Decoder s [RelativeTime] Source # | |||||
type Rep RelativeTime | |||||
Defined in Cardano.Slotting.Time type Rep RelativeTime = D1 ('MetaData "RelativeTime" "Cardano.Slotting.Time" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "RelativeTime" 'PrefixI 'True) (S1 ('MetaSel ('Just "getRelativeTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime))) |
Get current time (as RelativeTime
)
data SystemTime (m ∷ Type → Type) Source #
System time
Slots are counted from the system start.
Constructors
SystemTime | |
Fields
|
Instances
NoThunks (SystemTime m) Source # | |
Slot length
mkSlotLength ∷ NominalDiffTime → SlotLength Source #
Constructor for SlotLength
Conversions
opaque
data SlotLength Source #
Slot length
Precision is in milliseconds
Instances
FromCBOR SlotLength | |||||
Defined in Cardano.Slotting.Time | |||||
ToCBOR SlotLength | |||||
Defined in Cardano.Slotting.Time Methods toCBOR ∷ SlotLength → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SlotLength → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SlotLength] → Size Source # | |||||
Generic SlotLength | |||||
Defined in Cardano.Slotting.Time Associated Types
| |||||
Show SlotLength | |||||
Defined in Cardano.Slotting.Time Methods showsPrec ∷ Int → SlotLength → ShowS # show ∷ SlotLength → String # showList ∷ [SlotLength] → ShowS # | |||||
Eq SlotLength | |||||
Defined in Cardano.Slotting.Time | |||||
NoThunks SlotLength | |||||
Defined in Cardano.Slotting.Time | |||||
Serialise SlotLength | |||||
Defined in Cardano.Slotting.Time Methods encode ∷ SlotLength → Encoding Source # decode ∷ Decoder s SlotLength Source # encodeList ∷ [SlotLength] → Encoding Source # decodeList ∷ Decoder s [SlotLength] Source # | |||||
type Rep SlotLength | |||||
Defined in Cardano.Slotting.Time type Rep SlotLength = D1 ('MetaData "SlotLength" "Cardano.Slotting.Time" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "SlotLength" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSlotLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime))) |