diff options
author | Sean Riggin <sriggin@gmail.com> | 2015-05-20 14:03:55 -0600 |
---|---|---|
committer | Sean Riggin <sriggin@gmail.com> | 2015-05-26 14:30:10 -0600 |
commit | 3e159fa67afe8992a62ebdb00a324e4f133590cb (patch) | |
tree | 99dcf384470992c7c09ee191fdf3a99e0a926c77 /src | |
parent | 0c360f6d285fdea1fb240248b6c857cc942fbede (diff) | |
download | scala-3e159fa67afe8992a62ebdb00a324e4f133590cb.tar.gz scala-3e159fa67afe8992a62ebdb00a324e4f133590cb.tar.bz2 scala-3e159fa67afe8992a62ebdb00a324e4f133590cb.zip |
SI-9322 Elapsed times in compiler calculated with
System.currentTimeMillis and System.nanoTime
Reverted elapsedTime calculation in compiler to
use System.currentTimeMillis, consistent with
the start time.
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 |