Skip to content

Instantly share code, notes, and snippets.

@ashkrit
Created July 7, 2013 15:25
Show Gist options
  • Save ashkrit/5943800 to your computer and use it in GitHub Desktop.
Save ashkrit/5943800 to your computer and use it in GitHub Desktop.
JMH Asymmetric sample
private AtomicInteger counter;
@Setup
public void up() {
counter = new AtomicInteger();
}
@GenerateMicroBenchmark
@Group("g")
@Threads(8)
public int inc() {
return counter.incrementAndGet();
}
@GenerateMicroBenchmark
@Group("g")
public int get() {
return counter.get();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment