Skip to content

Commit b689e40

Browse files
committed
Allow bench task to pause between runs
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.
1 parent 94ed64b commit b689e40

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler/src/dotty/tools/dotc/Bench.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/* NSC -- new Scala compiler
2-
* Copyright 2005-2013 LAMP/EPFL
3-
* @author Martin Odersky
4-
*/
51
package dotty.tools
62
package dotc
73

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

0 commit comments

Comments
 (0)