print API phase time only if it is enabled

This commit is contained in:
Mark Harrah 2009-11-29 18:25:09 -05:00
parent 72f20c2f9a
commit c951156d9f
1 changed files with 5 additions and 3 deletions

View File

@ -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)
{