package duration
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=cd88da693951e1212ea83e24ce17f767e95a39a9ce2adda0654b32d75ce68c13
sha512=248fec8ba9ebf6ac7cc91055307496658974e402bb9de6d37027fbe51b6708247530392cc60f954cf8d7ed8a03ce0d2da440fbd9f8720e398a446e0a43f590ad
doc/duration/Duration/index.html
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.