Caliper is Google's open-source framework for writing, running and viewing the results of Java microbenchmarks.
See the Caliper project site, and online result viewer.
The simplest complete Caliper benchmark looks like this:
public class MyBenchmark extends SimpleBenchmark {
public void timeMyOperation(int reps) {
for (int i = 0; i < reps; i++) {
MyClass.myOperation();
}
}
}