diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-05-28 13:16:50 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-05-28 13:16:50 +0200 |
commit | 70f0b1ded880ec9b3a9478d02f1898fcfeee230c (patch) | |
tree | 300226fdb6b78ddcc08e09d1740fc17fe7dca44d /src | |
parent | b5c8f40f724e6f9d2eefc9933fb59c124b741df0 (diff) | |
parent | 3e159fa67afe8992a62ebdb00a324e4f133590cb (diff) | |
download | scala-70f0b1ded880ec9b3a9478d02f1898fcfeee230c.tar.gz scala-70f0b1ded880ec9b3a9478d02f1898fcfeee230c.tar.bz2 scala-70f0b1ded880ec9b3a9478d02f1898fcfeee230c.zip |
Merge pull request #4511 from sriggin/SI-9322
SI-9322 Elapsed times in compiler calculated with System.currentTimeMillis and System.nanoTime
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index b233acf271..4430a84f06 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -10,7 +10,6 @@ package nsc import java.io.{ File, FileOutputStream, PrintWriter, IOException, FileNotFoundException } import java.net.URL import java.nio.charset.{ Charset, CharsetDecoder, IllegalCharsetNameException, UnsupportedCharsetException } -import scala.compat.Platform.currentTime import scala.collection.{ mutable, immutable } import io.{ SourceReader, AbstractFile, Path } import reporters.{ Reporter, ConsoleReporter } @@ -1487,6 +1486,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter) compileUnitsInternal(units, fromPhase) private def compileUnitsInternal(units: List[CompilationUnit], fromPhase: Phase) { + def currentTime = java.util.concurrent.TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) + units foreach addUnit val startTime = currentTime diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala index 8fd2ea45e4..a22428075c 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala @@ -8,7 +8,6 @@ package symtab import classfile.ClassfileParser import java.io.IOException -import scala.compat.Platform.currentTime import scala.reflect.internal.MissingRequirementError import scala.reflect.internal.util.Statistics import scala.reflect.io.{ AbstractFile, NoAbstractFile } @@ -207,7 +206,7 @@ abstract class SymbolLoaders { override def complete(root: Symbol) { try { - val start = currentTime + val start = java.util.concurrent.TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) val currentphase = phase doComplete(root) phase = currentphase |