Benchmarking Time Unit

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Nov 1 13:19:31 PDT 2016


On Tuesday, 1 November 2016 at 18:39:01 UTC, Jonathan M Davis 
wrote:
> Alternatively, you can always do something like
>
> immutable before = MonoTime.currTime();
> // do stuf...
> immutable after = MonoTime.currTime();
> Duration timeSpent = after - before;

MonoTime has about 5-10 % fluctuations on my laptop. Is this as 
good as it gets?


More information about the Digitalmars-d-learn mailing list