package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-libs.base/Tezos_base/Time/index.html
Module Tezos_base.Time
Source
Time management
This module supports three distinct notions of time. The first notion of time is the time as handled by the protocol. This is the time that appears in the header of blocks, the time that baking slots are specified on, etc. It only has second-level precision.
The second notion of time is the time as handled by the system. This is the time as returned by the processor clock, the time that network timeouts are specified on, etc. It has sub-second precision.
As based on the system clock, this second notion of time is affected by system clock adjustments. If you need monotonous time, you can use the third notion introduced here.
The distinction between the notions of time is important for multiple reasons:
- Protocol time and system time may evolve independently. E.g., if a protocol update changes the notion of time.
- Protocol time and system time have different levels of precision.
- Protocol time and system time have different end-of-times. Respectively that's int64 end-of-time (some time in the year 292277026596) and RFC3339 end-of-time (end of the year 9999).
- Monotonic time is important if you want timeouts to be independant of calendar time adjustements.
Note that while Protocol time has the int64 range, many of its functions do not work outside of the RFC3339 range, namely:
- all
xx_notation_xx
functions (will be renamed and moved to an RFC submodule later) rfc_encoding
pp_hum