Skip to content

Commit a196c77

Browse files
Merge pull request #2142 from Microsoft/timeReporting
Ensure that the cost for typechecking is not billed to the emit portion of the compiler.
2 parents 7b8919f + a020a43 commit a196c77

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/compiler/program.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,15 @@ module ts {
177177
return { diagnostics: [], sourceMaps: undefined, emitSkipped: true };
178178
}
179179

180+
// Create the emit resolver outside of the "emitTime" tracking code below. That way
181+
// any cost associated with it (like type checking) are appropriate associated with
182+
// the type-checking counter.
183+
var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile);
184+
180185
var start = new Date().getTime();
181186

182187
var emitResult = emitFiles(
183-
getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile),
188+
emitResolver,
184189
getEmitHost(writeFileCallback),
185190
sourceFile);
186191

0 commit comments

Comments
 (0)