On Wednesday, 15 February 2017 at 15:58:41 UTC, Jonathan M Davis wrote:
[...]
     MonoTime before = MonoTime.currTime;
     Thread.sleep(dur!"msecs"(1000));
     MonoTime after = MonoTime.currTime;
     Duration timeElapsed = after - before;

     writeln(timeElapsed);
}
```
I get: "1 sec, 26 μs, and 4 hnsecs"

This is the correct way to do it. [...]

Oh, thanks for noting this. As I finally needed the seconds as an int (or long) I had to use timeElapsed.total!"seconds" which I would not have found out without Seb's posting. :-)

Reply via email to