Struct core.time.FracSec
Represents fractional seconds
.
This is the portion of the time which is smaller than a second and it cannot
hold values which would be greater than or equal to
a second (or less than
or equal to
a negative second).
It holds hnsecs
internally, but you can create it using either milliseconds,
microseconds, or hnsecs
. What it does is allow for a simple way to
set or
adjust the fractional seconds
portion of a
or a
Duration
std.datetime.SysTime
without having to
worry about whether you're
dealing with milliseconds, microseconds, or hnsecs
.
's functions which take time unit strings do accept
FracSec
"
, but because the resolution of nsecs
"
and
Duration
std.datetime.SysTime
is hnsecs
, you don't actually get precision higher
than hnsecs
. "
is accepted merely for convenience. Any values
given as nsecs
"nsecs
will be converted to
hnsecs
using
(which uses
truncating division when converting convert
to
smaller units).
Properties
Name | Type | Description |
---|---|---|
hnsecs
[get]
|
int |
The value of this as hnsecs .
|
hnsecs
[set]
|
int |
The value of this as hnsecs .
|
msecs
[get]
|
int |
The value of this as milliseconds.
|
msecs
[set]
|
int |
The value of this as milliseconds .
|
nsecs
[get]
|
int |
The value of this as nsecs .
|
nsecs
[set]
|
long |
The value of this as nsecs .
|
usecs
[get]
|
int |
The value of this as microseconds.
|
usecs
[set]
|
int |
The value of this as microseconds .
|
zero
[get]
|
FracSec |
A of 0 . It's shorter than doing something like
and more explicit than FracSec.init .
|
Methods
Name | Description |
---|---|
from
|
Create a from the given units (" , " ,
or " ).
|
opUnary
|
Returns the negation of this .
|
toString
|
Converts this to a string.
|
Authors
Jonathan M Davis and Kato Shoichi