Re: 1 - 17 ms, 553 ╬╝s, and 1 hnsec

Steven Schveighoffer schveiguy at gmail.com
Thu May 16 20:25:41 UTC 2019


On 5/16/19 9:17 PM, Steven Schveighoffer wrote:
> On 5/16/19 4:55 PM, Vladimir Panteleev wrote:
>> If the output is meant for the developer, then I disagree 
>> subjectively, as that creates the impression that the lowest 
>> resolution or representable unit of time is the nanosecond.
> 
> It is what it is. The reason hnsecs is used instead of nsecs is because 
> it gives a time range of 20,000 years instead of 2,000 years.
> 
> We do have a nanosecond resolution, and it's just rounded down to the 
> nearest 10.

And to prove my point about it being an obscure term, I forgot it's not 
10 nanoseconds, but 100 nanoseconds. oops!

> 
> For example:
> 
>      auto d = 15.nsecs;
>      assert(d == 10.nsecs);

This is not what I was trying to say, even though it's true (both are 
Duration.zero).

I meant:

auto d = 150.nsecs;
assert(d == 100.nsecs);

-Steve


More information about the Digitalmars-d-learn mailing list