TscTimePoint

A time point maintained through the TSC timer

TSC is a time counter maintained directly by the CPU. It counts how many "cycles" (loosly corresponding to actual CPU cycles) since an arbitrary start point. It is read by a single assembly instruciton, and is more efficient to read than kernel operatons.

Members

Aliases

frequency
alias frequency = cyclesPerSecond
Undocumented in source.

Functions

diff
long diff(TscTimePoint rhs)

Calculate difference between two TscTimePoint in the given units

opBinary
TscTimePoint opBinary(long cycles)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
TscTimePoint opBinary(Duration dur)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
TscTimePoint opBinary(long cycles)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
Duration opBinary(TscTimePoint rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
TscTimePoint opBinary(Duration dur)
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(TscTimePoint rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(TscTimePoint rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
auto ref opOpAssign(Duration dur)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
auto ref opOpAssign(long cycles)
Undocumented in source. Be warned that the author may not have intended to support it.
to
long to()

Convert to any of the units accepted by toDuration

toDuration
Duration toDuration()
toMsecs
long toMsecs()
toUsecs
long toUsecs()

Various conversion functions

Manifest constants

max
enum max;

Minimal, maximal and zero constants for reference.

min
enum min;
zero
enum zero;

Minimal, maximal and zero constants for reference.

Static functions

fromNow
auto fromNow(Duration dur)

Calculate a TscTimePoint for a set duration from now

fromSysTime
auto fromSysTime(SysTime time)

Calculate a TscTimePoint for a time given in systime from now

hardNow
TscTimePoint hardNow()

Get a TscTimePoint representing now.

now
TscTimePoint now()

Get a TscTimePoint representing now.

setHardNowThreshold
void setHardNowThreshold(ubyte interval)

Set the frequency with which we take a hard TSC reading

toCycles
long toCycles(Duration dur)
long toCycles(long n)
toDuration
Duration toDuration(long cycles)
toMsecs
long toMsecs(long cycles)
toUsecs
long toUsecs(long cycles)

Various conversion functions

Static variables

cyclesPerMsec
long cyclesPerMsec;

Provide the cycles/time ratio for the current machine.

cyclesPerMsecDivisor
S64Divisor cyclesPerMsecDivisor;

Prepared dividor for the cycles/time value

cyclesPerSecond
long cyclesPerSecond;

Provide the cycles/time ratio for the current machine.

cyclesPerSecondDivisor
S64Divisor cyclesPerSecondDivisor;

Prepared dividor for the cycles/time value

cyclesPerUsec
long cyclesPerUsec;

Provide the cycles/time ratio for the current machine.

cyclesPerUsecDivisor
S64Divisor cyclesPerUsecDivisor;

Prepared dividor for the cycles/time value

Variables

cycles
long cycles;

Time represented by TscTimePoint in units of cycles.

Meta