From: DRC Date: Wed, 28 Jun 2017 19:40:35 +0000 (-0500) Subject: Java TJBench: Fix parsing of -warmup argument X-Git-Tag: 1.5.2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e248d430e21e39c8d00bdb48dc99a70c1a1ed5e3;p=libjpeg-turbo Java TJBench: Fix parsing of -warmup argument Due to an oversight, this wasn't included in 1db1ce45da2e78d87ff05119b674c71d630926aa. --- diff --git a/java/TJBench.java b/java/TJBench.java index 415d8e1..5185d65 100644 --- a/java/TJBench.java +++ b/java/TJBench.java @@ -834,14 +834,15 @@ class TJBench { if (argv[i].equalsIgnoreCase("-nowrite")) write = false; if (argv[i].equalsIgnoreCase("-warmup") && i < argv.length - 1) { - int temp = -1; + double temp = -1; try { - temp = Integer.parseInt(argv[++i]); + temp = Double.parseDouble(argv[++i]); } catch (NumberFormatException e) {} - if (temp >= 0) { + if (temp >= 0.0) { 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("-?")) usage();