Commit a227c3ff authored by Noric Couderc's avatar Noric Couderc

Added Runner class and made it run

The ./gradle jmh task now runs the se.lth.cs.jmh.Main class instead of the usual
main class.
parent eb9d2390
......@@ -69,7 +69,7 @@ dependencies {
task jmh(type: JavaExec, dependsOn: jmhClasses) {
main = 'org.openjdk.jmh.Main'
main = 'se.lth.cs.jmh.Main'
classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath
package se.lth.cs.jmh;
import org.openjdk.jmh.results.format.ResultFormatType;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;
public class Main {
public static void main(String[] args) throws RunnerException {
System.out.println("Running the custom jmh runner.");
String[] seedsText = new String[10];
for (int i = 0; i < 10; ++i)
seedsText[i] = String.format("%d", i);
Options opts = new OptionsBuilder()
.param("seed", seedsText)
Runner r = new Runner(opts);;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment