[phobos] Proposal of StopWatch module
Michal Minich
michal.minich at gmail.com
Tue Aug 17 06:39:59 PDT 2010
On Tue, 17 Aug 2010 19:43:41 +0900, SHOO wrote:
> Here is the module to suggest this time:
> http://ideone.com/TVw1P
Very nicely coded. I think much better than the messing std.perf. Few
things...
1. I didn't found initialization of APPORIGIN. Is it meant to be
initialized in runtime, or else module constructor comes to my mind...
2. As a user of this module, I would much prefer to have an exception
throw when I call start or stop function out of order, instead of silent
return. If the only returns, there semantic requirement for having stop
function - it is has then same meaning as peek.
3. in std.perf the mili and microseconds use some special casing for
computation. I suppose it is to increase floating point accuracy. Does
this casing applies to your module and can it be used to increase
accuracy ?
and some much less important things...
4. I personally would prefer names like sec, usec, msec instead the
longer you use.
5. m_TimeObject is not an instance of any class. Better name could be
probably "m_TimeInit" "m_TimeInstanceInit"
6. Wouldn't be better to name the variable "m_FlagObserving" or
"m_FlagStarted" ?
7. ovserving is misspelled.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100817/471ec5f3/attachment.html>
More information about the phobos
mailing list