Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
DurationSourceDuration - conversions to various time units
A duration is represented in nanoseconds as an unsigned 64 bit integer. This has a range of up to 584 years, or 213503 days, or 5124095 hours, or 307445734 minutes, or 18446744073 seconds, or 18446744073709 milliseconds, or 18446744073709549 microseconds.
All functions converting to t raise Invalid_argument on out of bound or negative input.
v0.3.1 - homepage
The type for a duration (in nanoseconds), exposed as an int64 to provide interoperability.
pp ppf t prints the duration in a concise way.
of_string_exn str tries to parse str and calculate a duration. The user can specify a duration via metrics:
1ns for one nanoseconds1us, 1μs or 1µs for one microsecond1ms for one milliseconds1s for one second1m for one minute1h for one hour1d for one day1y/1a for one yearThe user can use multiple metrics but they can be used only once. 1d1d is invalid (you can use 2d) but 1d1y is valid and correspond to 1 year plus 1 day.
of_string is of_string_exn but it returns a result instead of raising an exception.