core.time Duration how to get units in double/float format?
Borislav Kosharov via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jan 17 06:43:26 PST 2016
Seeing that TickDuration is being deprecated and that I should
use Duration instead, I faced a problem. I need to get total
seconds like a float. Using .total!"seconds" returns a long and
if the duration is less than 1 second I get 0. My question is
whats the right way to do it. Because I saw that TickDuration has
a to!("seconds", float) method, but Duration doesn't have one. I
can convert Duration to TickDuration and call to but seeing that
its deprecated makes me think there is a better way.
More information about the Digitalmars-d-learn
mailing list