8143297: Nashorn compilation time reported in nanoseconds
Reviewed-by: hannesw, sundar
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Compiler.java Wed Nov 18 17:12:47 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Compiler.java Thu Nov 19 11:28:34 2015 +0100
@@ -46,6 +46,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.logging.Level;
@@ -684,7 +685,7 @@
if (time > 0L && timeLogger != null) {
assert env.isTimingEnabled();
- sb.append(" in ").append(time).append(" ms");
+ sb.append(" in ").append(TimeUnit.NANOSECONDS.toMillis(time)).append(" ms");
}
log.info(sb);
}