dur

fnDuration dur(string units)(long length) if (units == "weeks" || units == "days" || units == "hours" || units == "minutes" || units == "seconds" || units == "msecs" || units == "usecs" || units == "hnsecs" || units == "nsecs") @safe pure nothrow @nogc

These allow you to construct a Duration from the given time units with the given length.

You can either use the generic function dur and give it the units as a string or use the named aliases.

The possible values for units are "weeks", "days", "hours",

"minutes", "seconds", "msecs" (milliseconds), "usecs",

(microseconds), "hnsecs" (hecto-nanoseconds, i.e. 100 ns), and

"nsecs".

Parameters

unitsThe time units of the Duration (e.g. "days").
lengthThe number of units in the Duration.