Java TJBench: Fix parsing of -warmup argument

Due to an oversight, this wasn't included in
1db1ce45da.
This commit is contained in:
DRC
2017-06-28 14:40:35 -05:00
parent acb634931a
commit e248d430e2

View File

@@ -834,14 +834,15 @@ class TJBench {
if (argv[i].equalsIgnoreCase("-nowrite")) if (argv[i].equalsIgnoreCase("-nowrite"))
write = false; write = false;
if (argv[i].equalsIgnoreCase("-warmup") && i < argv.length - 1) { if (argv[i].equalsIgnoreCase("-warmup") && i < argv.length - 1) {
int temp = -1; double temp = -1;
try { try {
temp = Integer.parseInt(argv[++i]); temp = Double.parseDouble(argv[++i]);
} catch (NumberFormatException e) {} } catch (NumberFormatException e) {}
if (temp >= 0) { if (temp >= 0.0) {
warmup = temp; warmup = temp;
System.out.format("Warmup runs = %d\n\n", warmup); System.out.format("Warmup time = %.1f seconds\n\n", warmup);
} } else
usage();
} }
if (argv[i].equalsIgnoreCase("-?")) if (argv[i].equalsIgnoreCase("-?"))
usage(); usage();