Created
July 7, 2013 15:25
-
-
Save ashkrit/5943800 to your computer and use it in GitHub Desktop.
JMH Asymmetric sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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