Can I get the time "Duration" in "nsecs" acurracy?

dangbinghoo dangbinghoo at gmail.com
Tue Jul 13 00:52:30 UTC 2021


On Friday, 9 July 2021 at 20:43:48 UTC, rempas wrote:
> I'm reading the library reference for 
> [core.time](https://dlang.org/phobos/core_time.html#Duration) 
> and It says that the duration is taken in "hnsecs" and I cannot 
> understand if we can change that and choose the precision. Does 
> anyone know if we can do that?

don't expecting 1ns when you running software on GHz clocking CPU 
running with `normal-linux`.

1ns means 1Ghz. and common x86 cpu runs at 1-4Ghz, and in this 
situation, only 10ns will be expected from base-metal 
software(OS). as `normal-linux` is not real-time at all, 100ns is 
logical.


thanks!

dbh.


More information about the Digitalmars-d-learn mailing list