Hi Hari
Split was designed to work in multi-threaded environment, that's why
it is created for every stopwatch.start(). Original design used
internal thread local map that was proof to memory-leak, etc. This is
actually much lighter and more safe - if you forget about split, it
will get GCed. Split is not build for multiple measurements.
Technically there would be way how to reuse single split for more
measurements, some kind of restart method. I tried to experiment with
the idea and I see no problem to add it there, however it will appear
not sooner than 4.0 release (min req. Java SE 7), probably within a
couple of months.
As of now, if you need Simon for other features, I recommend using
some tool of yours and adding it to Stopwatch - HOWEVER, the only way
is addSplit(Split), which comes back to the "very heavy" Split.
Generally Split (a single object, not really that heavy) is not a
problem, but it is not recommended to do tons of measurements in tight
loops anyway. With restart this would be a little bit lighter, but
still not recommended. Calls to timers take long time on its own
anyway, much longer than the rest of Simon's stuff.
Cheers
Virgo
> --
> You received this message because you are subscribed to the Google Groups
> "javasimon" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
javasimon+...@googlegroups.com.
> To post to this group, send email to
java...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/javasimon.
> For more options, visit
https://groups.google.com/d/optout.