TickDuration

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 and confusing.

Represents a duration of time in system clock ticks.

The system clock ticks are the ticks of the system clock at the highest precision that the system provides.

Constructors

this
this(long ticks)

Members

Functions

hnsecs
long hnsecs()

Returns the total number of hecto-nanoseconds in this TickDuration.

msecs
long msecs()

Returns the total number of milliseconds in this TickDuration.

nsecs
long nsecs()

Returns the total number of nanoseconds in this TickDuration.

opBinary
TickDuration opBinary(TickDuration rhs)

Adds or subtracts two TickDurations.

opBinary
TickDuration opBinary(T value)

The legal types of arithmetic for TickDuration using this operator overload are

opBinary
TickDuration opBinary(T value)

The legal types of arithmetic for TickDuration using this operator overload are

opCast
Duration opCast()

Returns a Duration with the same number of hnsecs as this TickDuration. Note that the conventional way to convert between TickDuration and Duration is using std.conv.to, e.g.: tickDuration.to!Duration()

opCmp
int opCmp(TickDuration rhs)

operator overloading "<, >, <=, >="

opOpAssign
TickDuration opOpAssign(TickDuration rhs)

Adds or subtracts two TickDurations as well as assigning the result to this TickDuration.

opOpAssign
void opOpAssign(T value)

The legal types of arithmetic for TickDuration using this operator overload are

opOpAssign
void opOpAssign(T value)

The legal types of arithmetic for TickDuration using this operator overload are

opUnary
TickDuration opUnary()

Returns the negation of this TickDuration.

seconds
long seconds()

Returns the total number of seconds in this TickDuration.

usecs
long usecs()

Returns the total number of microseconds in this TickDuration.

Static functions

currSystemTick
TickDuration currSystemTick()

The current system tick. The number of ticks per second varies from system to system. currSystemTick uses a monotonic clock, so it's intended for precision timing by comparing relative time values, not for getting the current system time.

from
TickDuration from(long length)

This allows you to construct a TickDuration from the given time units with the given length.

max
TickDuration max()

Largest TickDuration possible.

min
TickDuration min()

Most negative TickDuration possible.

zero
TickDuration zero()

It's the same as TickDuration(0), but it's provided to be consistent with Duration and FracSec, which provide zero properties.

Static variables

appOrigin
TickDuration appOrigin;

The tick of the system clock (as a TickDuration) when the application started.

ticksPerSec
long ticksPerSec;

The number of ticks that the system clock has in one second.

Variables

length
long length;

The number of system ticks in this TickDuration.

Suggestion Box / Bug Report