The OpenD Programming Language

SysTime.fracSecs

Fractional seconds past the second (i.e. the portion of a SysTime which is less than a second).

  1. Duration fracSecs [@property getter]
    struct SysTime
    @property @safe const nothrow scope
    fracSecs
    ()
  2. Duration fracSecs [@property setter]

Examples

import core.time : msecs, usecs, hnsecs, nsecs;
import std.datetime.date : DateTime;

auto dt = DateTime(1982, 4, 1, 20, 59, 22);
assert(SysTime(dt, msecs(213)).fracSecs == msecs(213));
assert(SysTime(dt, usecs(5202)).fracSecs == usecs(5202));
assert(SysTime(dt, hnsecs(1234567)).fracSecs == hnsecs(1234567));

// SysTime and Duration both have a precision of hnsecs (100 ns),
// so nsecs are going to be truncated.
assert(SysTime(dt, nsecs(123456789)).fracSecs == nsecs(123456700));

Meta