View source code
Display the source code in core/time.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
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
local clone.
Struct core.time.TickDuration
Warning: TickDuration is deprecated. Please use
MonoTime
for the cases where a monotonic timestamp is needed
and Duration
when a duration is needed, rather than using
TickDuration.
struct TickDuration
;
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
Name | Description |
---|---|
this
(ticks)
|
Fields
Name | Type | Description |
---|---|---|
appOrigin
|
immutable(TickDuration) | The tick of the system clock (as a TickDuration ) when the
application started.
|
length
|
long | The number of system ticks in this TickDuration .
|
ticksPerSec
|
immutable(long) | The number of ticks that the system clock has in one second. |
Properties
Name | Type | Description |
---|---|---|
currSystemTick [get]
|
TickDuration | 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.
|
hnsecs [get]
|
long | Returns the total number of hecto-nanoseconds in this TickDuration .
|
max [get]
|
TickDuration | Largest TickDuration possible.
|
min [get]
|
TickDuration | Most negative TickDuration possible.
|
msecs [get]
|
long | Returns the total number of milliseconds in this TickDuration .
|
nsecs [get]
|
long | Returns the total number of nanoseconds in this TickDuration .
|
seconds [get]
|
long | Returns the total number of seconds in this TickDuration .
|
usecs [get]
|
long | Returns the total number of microseconds in this TickDuration .
|
zero [get]
|
TickDuration | It's the same as TickDuration(0) , but it's provided to be
consistent with Duration , which provides a zero property.
|
Methods
Name | Description |
---|---|
from
(length)
|
This allows you to construct a TickDuration from the given time
units with the given length.
|
opBinary
(rhs)
|
Adds or subtracts two TickDuration s.
|
opBinary
(value)
|
The legal types of arithmetic for TickDuration using this operator
overload are
|
opBinary
(value)
|
The legal types of arithmetic for TickDuration using this operator
overload are
|
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 to , e.g.:
tickDuration
|
opCmp
(rhs)
|
operator overloading "<, >, <=, >=" |
opOpAssign
(rhs)
|
Adds or subtracts two TickDuration s as well as assigning the result
to this TickDuration .
|
opOpAssign
(value)
|
The legal types of arithmetic for TickDuration using this operator
overload are
|
opOpAssign
(value)
|
The legal types of arithmetic for TickDuration using this operator
overload are
|
opUnary
()
|
Returns the negation of this TickDuration .
|
Authors
Jonathan M Davis and Kato Shoichi
License
Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.