<div dir="ltr">Thanks; shouldn't this be a function ?<div>we have SysTime.toTimeVal, why not Duration.toTimeVal?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 10, 2014 at 8:40 PM, Jonathan M Davis via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Monday, 11 August 2014 at 02:46:11 UTC, Timothee Cour via Digitalmars-d wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
On Sun, Aug 10, 2014 at 7:21 PM, Timothee Cour <<a href="mailto:thelastmammoth@gmail.com" target="_blank">thelastmammoth@gmail.com</a>><br>
wrote:<br>
<br>
</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This used to work prior to 2.066 (rc):<br>
Duration t;<br>
auto tv=timeval(t.total!"seconds",<u></u>t.fracSec.usecs);<br>
now it works but with:<br>
Deprecation: function core.time.Duration.fracSec is deprecated - Please<br>
use split instead.<br>
<br>
I see there's a SysTime.toTimeVal but there's no Duration.toTimeVal.<br>
Shouldn't there be?<br>
What would be the new recommended implementation?<br>
Also, I think deprecation messages could be more precise, telling exactly<br>
how to make the change instead of telling you the function name.<br>
<br>
<br>
</blockquote></div></div><div class="">
is this correct?<br>
    int secs,usecs;<br>
    timeout.split!("seconds","<u></u>usecs")(secs,usecs);<br>
    auto tv=timeval(secs,usecs);<br>
specifically, I'm not sure about the type 'int'.<br>
</div></blockquote>
<br>
Technically, timeval is<br>
<br>
struct timeval<br>
{<br>
    time_t      tv_sec;<br>
    suseconds_t tv_usec;<br>
}<br>
<br>
so tv_sec is 64-bits on a 64-bit system, though you'd probably get away with using an int. Regardless, I'd suggest doing this:<br>
<br>
timeval tv;<br>
timeout.split!("seconds, "usecs")(tv.tv_sec, tv.tv_usec);<br>
<br>
since then you don't have to care what integral type they are.<span class="HOEnZb"><font color="#888888"><br>
<br>
- Jonathan M Davis<br>
</font></span></blockquote></div><br></div>