From c951156d9f87063b6e6f8ec3fc7267a592592034 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sun, 29 Nov 2009 18:25:09 -0500 Subject: [PATCH] print API phase time only if it is enabled --- compile/interface/API.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compile/interface/API.scala b/compile/interface/API.scala index 6e785e86a..5ada0915e 100644 --- a/compile/interface/API.scala +++ b/compile/interface/API.scala @@ -27,11 +27,13 @@ final class API(val global: Global, val callback: xsbti.AnalysisCallback) extend def name = API.name def run: Unit = { - val start = System.currentTimeMillis if(java.lang.Boolean.getBoolean("sbt.api.enable")) + { + val start = System.currentTimeMillis currentRun.units.foreach(processUnit) - val stop = System.currentTimeMillis - println("API phase took : " + ((stop - start)/1000.0) + " s") + val stop = System.currentTimeMillis + println("API phase took : " + ((stop - start)/1000.0) + " s") + } } def processUnit(unit: CompilationUnit) {