File tree 2 files changed +9
-2
lines changed
compiler/src/dotty/tools/dotc
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ trait TraceSyntax:
96
96
(op : => T )(using Context ): T =
97
97
if ctx.mode.is(Mode .Printing ) || ! isForced && (printer eq Printers .noPrinter) then op
98
98
else
99
+ val start = System .nanoTime
99
100
// Avoid evaluating question multiple time, since each evaluation
100
101
// may cause some extra logging output.
101
102
val q = question
@@ -109,7 +110,13 @@ trait TraceSyntax:
109
110
def finalize (msg : String ) =
110
111
if ! finalized then
111
112
ctx.base.indent -= 1
112
- doLog(s " $margin$msg" )
113
+ val stop = System .nanoTime
114
+ val diffNs = stop - start
115
+ val diffS = (diffNs / 1000 / 1000 ).toInt / 1000.0
116
+ if diffS > 0.1 then
117
+ doLog(s " $margin$msg ( ${" %.2f" .format(diffS)} s) " )
118
+ else
119
+ doLog(s " $margin$msg" )
113
120
finalized = true
114
121
try
115
122
doLog(s " $margin$leading" )
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ trait ImportSuggestions:
264
264
end importSuggestions
265
265
266
266
/** Reduce next timeout for import suggestions by the amount of time it took
267
- * for current search, but but never less than to half of the previous budget.
267
+ * for current search, but never less than to half of the previous budget.
268
268
*/
269
269
private def reduceTimeBudget (used : Int )(using Context ) =
270
270
val run = ctx.run.nn
You can’t perform that action at this time.
0 commit comments