Expand description
Wall-clock conversion, parsing, and duration-formatting utilities.
The helpers convert between SystemTime and the Unix epoch, parse
human-readable durations, and choose display units. These clocks are not
monotonic and can be affected by system-time changes.
Modules§
- exponential_
backoff - Retry-backoff calculations.
Enums§
- Unit
- Represents an integral duration in one selected unit.
Functions§
- duration_
since_ epoch - Converts a system time into a nonnegative duration since the Unix epoch.
- format
- Formats a system time in UTC with a Chrono format string.
- now
- Returns the current wall-clock duration since the Unix epoch.
- now_
millis - Returns the current wall-clock time as whole milliseconds since the Unix epoch.
- now_
secs - Returns the current wall-clock time as whole seconds since the Unix epoch.
- parse_
duration - Parses a human-readable duration with the
cyborgtimeparser. - parse_
timepoint_ ago - Parses a duration and returns the wall-clock time that far in the past.
- pretty
- Formats a duration with one plural human-readable unit.
- rfc2822_
from_ seconds - Formats a signed Unix timestamp as RFC 2822 text in UTC.
- timepoint_
ago - Subtracts a duration from the current wall-clock time using checked arithmetic.
- timepoint_
from_ epoch - Adds a duration to the Unix epoch using checked arithmetic.
- timepoint_
from_ now - Adds a duration to the current wall-clock time using checked arithmetic.
- timepoint_
has_ passed - Checks whether a system time is at or before the current wall-clock time.
- whole_
and_ frac - Pairs a duration’s selected whole unit with a floating-point scale component.
- whole_
unit - Selects the largest integral unit represented by a duration.