summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-05-20 08:49:25 -0700
committerGitHub <noreply@github.com>2024-05-20 08:49:25 -0700
commite913cb9526c62727c35709166b93fdac3725acd2 (patch)
tree6b8c0820ccc05311ad43143c80ef991eef8d4759 /source
parent07c29d8b1248135cc453b1c4e38b5f7d06cb7928 (diff)
Printing a timing of stdlib build time (#4190)
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index b60630f02..8b0012f1d 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -319,6 +319,8 @@ SlangResult Session::compileStdLib(slang::CompileStdLibFlags compileFlags)
#ifdef _DEBUG
// Print a message in debug builds to notice the user that compiling the stdlib
// can take a while.
+ time_t beginTime;
+ time(&beginTime);
fprintf(stderr, "Compiling stdlib on debug build, this can take a while.\n");
#endif
@@ -372,6 +374,11 @@ SlangResult Session::compileStdLib(slang::CompileStdLibFlags compileFlags)
finalizeSharedASTBuilder();
+#ifdef _DEBUG
+ time_t endTime;
+ time(&endTime);
+ fprintf(stderr, "Compiling stdlib took %.2f seconds.\n", difftime(endTime, beginTime));
+#endif
return SLANG_OK;
}