Skip to content

Instantly share code, notes, and snippets.

@andrebrait
Created December 28, 2018 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrebrait/9f5c10e178cc2d79b3e457c0e962fa7d to your computer and use it in GitHub Desktop.
Save andrebrait/9f5c10e178cc2d79b3e457c0e962fa7d to your computer and use it in GitHub Desktop.
@State(Scope.Thread)
public static class MyState {
public int a = 1;
public int b = 2;
}
@Benchmark
public int testMethod(MyState state) {
int sum = state.a + state.b;
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment