You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <gg...@seagullsw.com> on 2004/05/19 05:22:03 UTC
[lang] StopWatch stop vs. split?
Hello
The StopWatch method stop and split do the same thing. Why have both?
It's confusing.
Thanks,
Gary
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: [lang] StopWatch stop vs. split?
Posted by Tim O'Brien <to...@discursive.com>.
State management would be valuable: I made it a Bug:
http://issues.apache.org/bugzilla/show_bug.cgi?id=29163
Tim
> -----Original Message-----
> From: Henri Yandell [mailto:bayard@generationjava.com]
> Sent: Sunday, May 23, 2004 3:45 PM
> To: Jakarta Commons Developers List
> Subject: Re: [lang] StopWatch stop vs. split?
>
>
> Yep. They're meant to mimic the stopwatch I had as a kid :) Split would
> set the time, but let the stopwatch carry on working wheras stop would set
> the time and stop the watch continuing.
>
> The implementation ended up being the same. The only thing I can think of
> is to throw Exceptions if people try to call split or stop again.
>
> Hen
>
> On Wed, 19 May 2004, matthew.hawthorne wrote:
>
> > Gary Gregory wrote:
> > > The StopWatch method stop and split do the same thing. Why have both?
> > > It's confusing.
> >
> > After taking a look at the javadocs, I don't think that they're supposed
> > to do the same thing,
> > they've just been coded that way. It seems that stop() is supposed to
> > reset the start time, and
> > split() isn't. Maybe adding a startTime = -1 to the stop() method would
> > fix this?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [lang] StopWatch stop vs. split?
Posted by Henri Yandell <ba...@generationjava.com>.
Yep. They're meant to mimic the stopwatch I had as a kid :) Split would
set the time, but let the stopwatch carry on working wheras stop would set
the time and stop the watch continuing.
The implementation ended up being the same. The only thing I can think of
is to throw Exceptions if people try to call split or stop again.
Hen
On Wed, 19 May 2004, matthew.hawthorne wrote:
> Gary Gregory wrote:
> > The StopWatch method stop and split do the same thing. Why have both?
> > It's confusing.
>
> After taking a look at the javadocs, I don't think that they're supposed
> to do the same thing,
> they've just been coded that way. It seems that stop() is supposed to
> reset the start time, and
> split() isn't. Maybe adding a startTime = -1 to the stop() method would
> fix this?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [lang] StopWatch stop vs. split?
Posted by "matthew.hawthorne" <ma...@apache.org>.
Gary Gregory wrote:
> The StopWatch method stop and split do the same thing. Why have both?
> It's confusing.
After taking a look at the javadocs, I don't think that they're supposed
to do the same thing,
they've just been coded that way. It seems that stop() is supposed to
reset the start time, and
split() isn't. Maybe adding a startTime = -1 to the stop() method would
fix this?
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org