Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
Module containing core time functionality, such as Duration (which
represents a duration of time) or MonoTime (which represents a
timestamp of the system's monotonic clock).
Various functions take a string (or strings) to represent a unit of time
(e.g. convert!("days", "hours")(numDays)). The valid strings to use
with such functions are "years", "months", "weeks", "days", "hours",
"minutes", "seconds", "msecs" (milliseconds), "usecs" (microseconds),
"hnsecs" (hecto-nanoseconds - i.e. 100 ns) or some subset thereof. There
are a few functions that also allow "nsecs", but very little actually
has precision greater than hnsecs.
Generic way of converting between two time units. Conversions to smaller
units use truncating division. Years and months can be converted to each
other, small units can be converted to each other, but years and months
cannot be converted to or from smaller units (due to the varying number
of days in a month or year).
Everything in druntime and Phobos that was using FracSec now uses
Duration for greater simplicity. So, FracSec has been deprecated.
It will be removed from the docs in October 2018, and removed
completely from druntime in October 2019.
Warning: TickDuration will be deprecated in the near future (once all
uses of it in Phobos have been deprecated). Please use
MonoTime for the cases where a monotonic timestamp is needed
and Duration when a duration is needed, rather than using
TickDuration. It has been decided that TickDuration is too confusing
(e.g. it conflates a monotonic timestamp and a duration in monotonic
clock ticks) and that having multiple duration types is too awkward
alias for MonoTimeImpl instantiated with ClockType.normal. This is
what most programs should use. It's also what much of MonoTimeImpl uses
in its documentation (particularly in the examples), because that's what's
going to be used in most code.