Skip to content

Commit 5662938

Browse files
author
Ben Asher
committed
Round to nearest 100th of a millisecond
1 parent 6e49cf0 commit 5662938

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/TypeCheckStmt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ namespace {
155155
ASTContext &ctx = Function.getAsDeclContext()->getASTContext();
156156

157157
if (ShouldDump) {
158-
llvm::errs() << llvm::format("%0.3f", elapsed * 1000) << "ms\t";
158+
// Round to the nearest 100th of a millisecond
159+
llvm::errs() << llvm::format("%0.2f", round(elapsed * 100000) / 100) << "ms\t";
159160
Function.getLoc().print(llvm::errs(), ctx.SourceMgr);
160161

161162
if (auto *AFD = Function.getAbstractFunctionDecl()) {

0 commit comments

Comments
 (0)