var.isDuration

bool isDuration() @property const nothrow @nogc pure @safe

Check if this var holds a Duration value.

More readable alternative to v.type == var.Type.DURATION.

Returns

true if the value is a time duration, false otherwise.

Examples

import core.time : hours;
var dur = hours(2);
assert(dur.isDuration);
var i = 7200;
assert(!i.isDuration);