Re: Converting Duration to TickDuration

2011-09-19 Thread Jonathan M Davis
On Tuesday, September 13, 2011 04:32:28 Vladimir Panteleev wrote: > The simplest way I found is: > TickDuration.from!"hnsecs"(duration.total!"hnsecs") > > Is there a simpler way? There's now a pull request which adds opCast to Duration which casts to TickDuration: https://github.com/D-Programmin

Re: Converting Duration to TickDuration

2011-09-13 Thread Jonathan M Davis
On Tuesday, September 13, 2011 15:45:27 Vladimir Panteleev wrote: > On Tue, 13 Sep 2011 06:27:44 +0300, Jonathan M Davis > > wrote: > > Personally, I'd just Duration far those and not TickDuration. Duration > > is just > > as precise (if not more precise) than TickDuration as long as the system >

Re: Converting Duration to TickDuration

2011-09-13 Thread Vladimir Panteleev
On Tue, 13 Sep 2011 06:27:44 +0300, Jonathan M Davis wrote: Personally, I'd just Duration far those and not TickDuration. Duration is just as precise (if not more precise) than TickDuration as long as the system ticks aren't less than 1 hnsec apart. TickDuration is useful in that it gives

Re: Converting Duration to TickDuration

2011-09-12 Thread Jonathan M Davis
On Tuesday, September 13, 2011 05:13:02 Vladimir Panteleev wrote: > On Tue, 13 Sep 2011 05:01:31 +0300, Jonathan M Davis > > wrote: > > What are you doing that you want to create a TickDuration from a > > Duration? > > On the one side, I have a module for running scheduled events. Event > timing

Re: Converting Duration to TickDuration

2011-09-12 Thread Vladimir Panteleev
On Tue, 13 Sep 2011 05:01:31 +0300, Jonathan M Davis wrote: What are you doing that you want to create a TickDuration from a Duration? On the one side, I have a module for running scheduled events. Event timing is specified using a TickDuration, indicating the time interval after which

Re: Converting Duration to TickDuration

2011-09-12 Thread Jonathan M Davis
On Tuesday, September 13, 2011 04:32:28 Vladimir Panteleev wrote: > The simplest way I found is: > TickDuration.from!"hnsecs"(duration.total!"hnsecs") > > Is there a simpler way? I don't believe so. A TickDuration can be cast (or use std.conv.to) to convert to a Duration, but there is no cast in