Skip to content

Commit

Permalink
Allow bench task to pause between runs
Browse files Browse the repository at this point in the history
If -Xprompt is set, pause a dotty.tools.dotc.Bench task between compiler
runs. This is useful for, e.g. taking a memory snapshot at a predictable time.
  • Loading branch information
odersky committed Oct 4, 2017
1 parent dbe64c1 commit 3be3bea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions compiler/src/dotty/tools/dotc/Bench.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Martin Odersky
*/
package dotty.tools
package dotc

Expand All @@ -24,6 +20,11 @@ object Bench extends Driver {
val start = System.nanoTime()
val r = super.doCompile(compiler, fileNames)
println(s"time elapsed: ${(System.nanoTime - start) / 1000000}ms")
if (ctx.settings.prompt.value) {
print("hit <return> to continue >")
System.in.read()
println()
}
r
}

Expand Down

0 comments on commit 3be3bea

Please sign in to comment.