Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 70f0b1d

Browse files
committed
Merge pull request scala#4511 from sriggin/SI-9322
SI-9322 Elapsed times in compiler calculated with System.currentTimeMillis and System.nanoTime
2 parents b5c8f40 + 3e159fa commit 70f0b1d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ package nsc
1010
import java.io.{ File, FileOutputStream, PrintWriter, IOException, FileNotFoundException }
1111
import java.net.URL
1212
import java.nio.charset.{ Charset, CharsetDecoder, IllegalCharsetNameException, UnsupportedCharsetException }
13-
import scala.compat.Platform.currentTime
1413
import scala.collection.{ mutable, immutable }
1514
import io.{ SourceReader, AbstractFile, Path }
1615
import reporters.{ Reporter, ConsoleReporter }
@@ -1487,6 +1486,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
14871486
compileUnitsInternal(units, fromPhase)
14881487

14891488
private def compileUnitsInternal(units: List[CompilationUnit], fromPhase: Phase) {
1489+
def currentTime = java.util.concurrent.TimeUnit.NANOSECONDS.toMillis(System.nanoTime())
1490+
14901491
units foreach addUnit
14911492
val startTime = currentTime
14921493

src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package symtab
88

99
import classfile.ClassfileParser
1010
import java.io.IOException
11-
import scala.compat.Platform.currentTime
1211
import scala.reflect.internal.MissingRequirementError
1312
import scala.reflect.internal.util.Statistics
1413
import scala.reflect.io.{ AbstractFile, NoAbstractFile }
@@ -207,7 +206,7 @@ abstract class SymbolLoaders {
207206

208207
override def complete(root: Symbol) {
209208
try {
210-
val start = currentTime
209+
val start = java.util.concurrent.TimeUnit.NANOSECONDS.toMillis(System.nanoTime())
211210
val currentphase = phase
212211
doComplete(root)
213212
phase = currentphase

0 commit comments

Comments
 (0)