Resolution of core.time.Duration...

Steven Schveighoffer schveiguy at yahoo.com
Tue May 17 07:47:17 PDT 2011


On Tue, 17 May 2011 09:42:27 -0400, Daniel Gibson <metalcaedes at gmail.com>  
wrote:

> Am 17.05.2011 15:25, schrieb Steven Schveighoffer:
>>
>> I agree that accepting a long as an alternative to Duration, it makes
>> sense to use a more normal tick resolution.  The chances of someone
>> wanting to have their process sleep for more than 300 years (e.g. for
>> nanosecond resolution) is pretty small.  This might be a worthwhile  
>> change.
>>
>> I'm not sure how much code this might affect, though.  It would be
>> plenty disturbing if your code started sleeping for 100ms instead of the
>> 10s you thought you requested.  What might be a good path is to disable
>> those functions that accept a long for a few releases, then re-instate
>> them with a new meaning.
>>
>
> Or just add nanoSleep() or something like that.

Probably a good idea, and deprecate Thread.sleep(long).  It's more  
self-documenting.

-Steve


More information about the Digitalmars-d mailing list