[Issue 12955] New: Deprecated std.datetime.measureTime. It's redundant functionality.
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Jun 20 02:11:26 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12955
Issue ID: 12955
Summary: Deprecated std.datetime.measureTime. It's redundant
functionality.
Product: D
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: jmdavisProg at gmx.com
{
auto mt = measureTime!((TickDuration a)
{ /+ do something when the scope is exited +/ });
// do something that needs to be timed
}
is functionally equivalent to
{
auto sw = StopWatch(AutoStart.yes);
scope(exit)
{
TickDuration a = sw.peek();
/+ do something when the scope is exited +/
}
// do something that needs to be timed
}
making measureTime redundant. So, it should be deprecated.
And this is a deprecation that Walter Bright actually endorses. When discussing
the differences between benchmark and measureTime, when he was trying to figure
out how to time some code, he agreed with my assessment that measureTime was
redundant and that it should be removed, because it basically just does what
scope(exit) does already except that it's less flexible.
--
More information about the Digitalmars-d-bugs
mailing list