TickDuration deprecation
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Sun Nov 19 16:02:34 UTC 2017
On Sunday, November 19, 2017 15:01:50 Rumbu via Digitalmars-d wrote:
> On Saturday, 18 November 2017 at 22:46:20 UTC, Jon Degenhardt
>
> wrote:
> > I admittedly don't understand the argument that it should be
> > hard to user programs to convert time durations to alternate
> > standard units of measure. But even so, it would seem to make
> > sense for the documentation of std.datetime.stopwatch to
> > provide clear examples of printing a duration in different
> > standard time units. In documentation's current form, it takes
> > quite a bit of digging to figure out how to do this. I'd
> > recommend at least making it clear in the documentation how to
> > do this. Yes, this would also make it easier for users to
> > convert to float, but printing in standard units of measure is
> > a rather basic operation.
>
> +1.
>
> I had the same problem with some benchmark intensive project. It
> took me some time to resolve the deprecations, but I lost more
> time diging for a way to display times in a human readable form.
> Internal representations of durations are useless if you cannot
> display them in a standard unit of measure.
Was the documentation on Duration not informative enough, or did you have
trouble finding it from the documentation for the benchmarking functions, or
something else? Simply converting a Duration to a string gives you what I
would have thought would have been plenty human readable (though obviously
not necessarily what you want in all cases), and it's split and total
functions should make it straightforward to put the result in some other
format if that's what you want. Was the documentation on those not enough?
- Jonathan M Davis
More information about the Digitalmars-d
mailing list