I am trying to use Google Caliper to benchmark some simple code. I am using the examples from their websites. Here's what I've done so far:
- Downloaded the Caliper JAR and added it to my Netbeans project
- After having difficulties, I downloaded JUnit.jar and hamcrest.jar. Still not working.
Here's my code:
import com.google.caliper.Benchmark;
public class Benchmark1 extends Benchmark {
public void timeNanoTime(int reps) {
for (int i = 0; i < reps; i++) {
System.nanoTime();
}
}
}
I am extending Benchmark because when I try to extend "SimpleBenchmark" like on their website it tells me it cannot find SimpleBenchmark. I then, in my main method, create a new Benchmark1() hoping something will happen. Nothing does. This is the code inside my main class.
Benchmark1 test = new Benchmark1();
test.timeNanoTime(10);
I know this is no doubt a simple error but I cannot, despite much Googling, figure out where I'm going wrong. The code compiles but does not run.
EDIT: I should say I'm running Netbeans on Windows 7 with Caliper 1.0