On Wednesday, 22 May 2019 at 00:22:09 UTC, JS wrote:
xxx = 0; sw.reset(); sw.start(); for(double i = 0; i < 10000000; i++) xxx += sin(PI*i); t = sw.peek().msecs; writeln(t); sw.stop(); }
What you are doing wrong is that xxx is never used... So DMD removes it altogether?
If you add writeln(xxx) after the second loop as well, then maybe the measurements make more sense?
Ola.