"Common sense is the collection of prejudices acquired by age eighteen" - Albert Einstein
Commsen's logo

Stopwatch

Stopwatch is a simple but highly extensible API that alows monitoring of any part of the application. It reports hits, execution times and load but can be extended to do more via custom engines. It is able to persist data in "in-memory" or real database.

Synopsis

Here is a very simple example. This code 

Stopwatch.setActive(true);
for (int count = 0; count < 21; count++) {
long id = Stopwatch.start("my group", "my label");
// some code to be measured
Stopwatch.stop(id);
}
System.out.print(Stopwatch.getSingleReport("my group", "my label"));

will print somethig like this

Group="my group"  Label="my label"  Count=21  Min=12ms  Avg=13ms  Max=32ms  Total=274ms  

For documentation and more examples please visit dedicated site.

SourceForge.net logo

As many other open source projects, Stopwatch is hosted at SourceForge. 

Project sitehttp://jstopwatch.sourceforge.net
Downloadhttp://sourceforge.net/project/platformdownload.php?group_id=160328
Source codehttp://svn.sourceforge.net/svnroot/jstopwatch/stopwatch