digitalmars.D.learn - Pretty Printing TickDuration
- =?UTF-8?B?Tm9yZGzDtnc=?= (11/11) Sep 17 2015 Currently
- =?UTF-8?B?Tm9yZGzDtnc=?= (3/4) Sep 17 2015 Solution:
Currently import std.datetime: StopWatch; StopWatch sw; sw.start; writeln(sw.peek()); prints for instance TickDuration(279483) I've seen Phobos doing something much more clever such as pretty printing of time in the format: 1 hour, 2 seconds, 3 milliseconds, etc. How do I convert an instance of `TickDuration` to that format?
Sep 17 2015
On Thursday, 17 September 2015 at 16:54:02 UTC, Nordlöw wrote:How do I convert an instance of `TickDuration` to that format?Solution: writeln("> Query took ", sw.peek().to!Duration);
Sep 17 2015