Duration.toTimeVal ? (following deprecation from 2.066)

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 10 19:45:56 PDT 2014


On Sun, Aug 10, 2014 at 7:21 PM, Timothee Cour <thelastmammoth at gmail.com>
wrote:

> This used to work prior to 2.066 (rc):
> Duration t;
> auto tv=timeval(t.total!"seconds",t.fracSec.usecs);
> now it works but with:
> Deprecation: function core.time.Duration.fracSec is deprecated - Please
> use split instead.
>
> I see there's a SysTime.toTimeVal but there's no Duration.toTimeVal.
> Shouldn't there be?
> What would be the new recommended implementation?
> Also, I think deprecation messages could be more precise, telling exactly
> how to make the change instead of telling you the function name.
>
>
is this correct?
    int secs,usecs;
    timeout.split!("seconds","usecs")(secs,usecs);
    auto tv=timeval(secs,usecs);
specifically, I'm not sure about the type 'int'.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140810/34d61d41/attachment.html>


More information about the Digitalmars-d mailing list