Is there something (planned) in the D Library to support high precision timers like QueryPerformanceCounter in c++ ? How can I have a portable High precision timer in D ?
Or if it is not available, what would be the highest percision timer in D ?
std.datetime has the StopWatch struct for handling precision timing - and it uses QueryPerformanceCounter
internally on Windows. On other OSes, it uses whatever the appropriate, high precision monotonic clock is for them.
If what you need is ticks of the system clock rather than a timer specifically, you can call Clock.currSystemTick for the current tick of the system clock (or Clock.currAppTick for the number of system clock ticks since the application started). But StopWatch
is what you want if you want a timer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With