0

I don't seem to be able to get started here. I pulled down the code and built caliper myself, which solved my first set of problems, but now I am getting errors that I need a microinstrument

This experiment requires a microbenchmark. The granularity of the timer (535ns) is greater than 0.1% of the measured runtime (331.0μs). Use the microbenchmark instrument for accurate measurements.

so, how do I set the micro instrument?

I'm using @Benchmark before the method I want to run, and inside my main looks like this:

CaliperMain.main(
    MyClass.class,
    new String[]{ "-i", "runtime" }
);

I tried changing runtime to "micro", but that didn't work. Any ideas?

blalasaadri
  • 5,990
  • 5
  • 38
  • 58

1 Answers1

0

I guess, all you need is to use

@Benchmark int time(int reps) {
    // repeat reps times what you want to measure
}

instead of

@Benchmark int time() {
}
maaartinus
  • 44,714
  • 32
  • 161
  • 320