Safe Haskell | None |
---|---|
Language | Haskell2010 |
RON.Epoch
Synopsis
- data EpochClock a
- decode :: EpochTime -> UTCTime
- encode :: POSIXTime -> EpochTime
- getCurrentEpochTime :: IO EpochTime
- localEpochTimeFromUnix :: Word64 -> LocalTime
- runEpochClock :: ReplicaId -> IORef EpochTime -> EpochClock a -> IO a
- runEpochClockFromCurrentTime :: ReplicaId -> EpochClock a -> IO a
Documentation
data EpochClock a Source #
Real epoch clock. Uses kind of global variable to ensure strict monotonicity.
Instances
getCurrentEpochTime :: IO EpochTime Source #
Get current time in EpochTime
format (with 100 ns resolution).
Monotonicity is not guaranteed.
localEpochTimeFromUnix :: Word64 -> LocalTime Source #
Convert unix time in hundreds of milliseconds to RFC 4122 time.
runEpochClock :: ReplicaId -> IORef EpochTime -> EpochClock a -> IO a Source #
Run EpochClock
action with explicit time variable.
runEpochClockFromCurrentTime :: ReplicaId -> EpochClock a -> IO a Source #
Like runEpochClock
, but initialize time variable with current wall time.