Skip to content

Commit

Permalink
Printing a timing of stdlib build time (shader-slang#4190)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwak-work authored May 20, 2024
1 parent 07c29d8 commit e913cb9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/slang/slang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit e913cb9

Please sign in to comment.