Skip to content

Commit 817cf1b

Browse files
committed
Add scene cache loading timer
If the scene wasn't loaded from cache, loadScene will print the time it took to load and process.
1 parent 1cef736 commit 817cf1b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/niagara.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,8 @@ int main(int argc, const char** argv)
632632
{
633633
std::string cachePath = std::string(argv[1]) + ".cache";
634634

635+
double sceneTimer = glfwGetTime();
636+
635637
if (!loadSceneCache(cachePath.c_str(), geometry, materials, draws, texturePaths, camera, sunDirection, clrtMode))
636638
{
637639
printf("Loading scene from %s\n", argv[1]);
@@ -647,6 +649,10 @@ int main(int argc, const char** argv)
647649
return 1;
648650
}
649651
}
652+
else
653+
{
654+
printf("Loaded scene from cache %s in %.2f sec\n", cachePath.c_str(), glfwGetTime() - sceneTimer);
655+
}
650656

651657
sceneMode = true;
652658
}

0 commit comments

Comments
 (0)