package duration
Module DurationSource
Duration - 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:
1nsfor one nanoseconds1us,1μsor1µsfor one microsecond1msfor one milliseconds1sfor one second1mfor one minute1hfor one hour1dfor one day1y/1afor one year
The 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.