www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Out of data wiki

reply Mike B Johnson <Mikey Ikes.com> writes:
can this be updated to work?

https://wiki.dlang.org/Timing_Code
Apr 18 2017
parent Jonathan M Davis via Digitalmars-d-learn writes:
On Tuesday, April 18, 2017 19:54:26 Mike B Johnson via Digitalmars-d-learn 
wrote:
 can this be updated to work?

 https://wiki.dlang.org/Timing_Code
Wow, that's using some old stuff - stuff older than the wiki. Weird. It was probably ported from somewhere. The best thing to use now is core.time.MonoTime. e.g. MonoTime before = MonoTime.currTime(); ... MonoTime after = MonoTime.currTime(); Duration diff = before - after; There are also some benchmarking functions in std.datetime, but they use TickDuration (which is slated to be deprecated) and need to be replaced with versions that use MonoTime. - Jonathan M Davis
Apr 18 2017