[Issue 15502] Error: function core.time.dur!"nsecs".dur (long length) is not callable using argument types (MonoTimeImpl!cast(ClockType)0)

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 4 03:11:47 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15502

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m
         Resolution|---                         |INVALID

--- Comment #3 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
I confess that I don't understand what you're trying to do.

core.time.MonoTime.currTime.ticks.nsecs.total!"nsecs"

makes no sense at all. And doing the same thing with TickDuration would have
been just as broken. currSystemTick returns the current tick of the system's
monotonic clock as a TickDuration. It is _not_ a duration but a point in time
(which is part of why TickDuration is being phased out - it's used both as a
duration and a time point). So, converting it to nanoseconds is meaningless.
And converting MonoTime to nanoseconds is just as meaningless. It would be like
trying to convert 2016-01-04T12:00:07 to nanoseconds, only 2016-01-04T12:00:07
is the wall clock time not the time from the monotonic clock (which is just in
ticks).

Please read the documentation for MonoTime. Based on what you're trying to do
here, you do not appear to understand either TickDuration or MonoTime.

--


More information about the Digitalmars-d-bugs mailing list