- Add JavaDoc comments
- Minor code cleanup
- Add
start(String, Runnable)
feature to measureRunnable
code snippets on the fly.
- Add
pause()
andresume()
features inStopwatch
.
- Fix incorrect calculation of fraction digits in
NumberFormatter
.
- Add percentage information to the output.
- Add
NumberFormatter.percentage()
method to format the given value. - Add more constructors to
WatchItem
. - Change some column names in the output to be shorter.
- Support
getTotalElapsedMilliseconds()
andgetTotalElapsedSeconds()
methods inStopwatch
. - Support
add()
method inStopwatch
to customize the output.
Stopwatch stopwatch = new Stopwatch();
stopwatch.start("first phase");
// ...
stopwatch.stop();
stopwatch.start("second phase");
// ...
stopwatch.stop();
stopwatch.print();
| name | elapsed(ms) | elapsed(s) |
|--------------|-------------|------------|
| first phase | 1,234ms | 1.234s |
| second phase | 830ms | 0.830s |