Java Micro Benchmarks - how to do it! Measuring performance seams to be easy. Take a time-stamp before your method call, take another one after it and calculate the difference. But what about the JVM? What about class loading? What about Just-in-time compilation? What about code optimization?