Closed zsx closed 6 years ago
Hi,
The times (particular for demos) needs to have how much time has actually passed; std::clock() gives CPU time of the process. However, I suggest using std::chrono::steady_clock() instead.
@krogueintel Hmm, I've looked into the code, and I didn't see it needed the wallclock anywhere. Could you show me the code?
The case in gl_program.cpp is needed to know how long it takes (from program time startup) for the uber-shaders to compile; some drivers do a multi-threading thing so CPU time is not actual time.
For demos, the use case is entirely for real (clock time) changes to measuring FPS and performance. As such CPU time is not what is wanted (since usually graphically intense applications are bottle necked by the GPU).
@krogueintel OK, I see. Thanks for the explanation. I'll update this series.
@krogueintel I have respun the series with std::chrono::steady_clock.
It's not available on Windows, and because only the elapsed time is needed, std::clock() is good enough.