|
QuasarEngine
Cross-platform 3D engine and editor
|
Timer that logs how long a scope took when the scope ends. More...
Go to the source code of this file.
Classes | |
| class | Quasar::ScopedTimer |
| Measures the time between its creation and the end of its scope, then logs it as an engine info message. More... | |
Namespaces | |
| namespace | Quasar |
| Contains all the engine code. | |
Macros | |
| #define | QUASAR_SCOPED_TIMER(name) |
| Measures the rest of the current scope and logs the time with the given name. | |
Timer that logs how long a scope took when the scope ends.
| #define QUASAR_SCOPED_TIMER | ( | name | ) |
Measures the rest of the current scope and logs the time with the given name.
Removed from Release builds, where name is still checked by the compiler but never evaluated.
{ QUASAR_SCOPED_TIMER("LoadScene"); LoadScene(); }
The macro creates a ScopedTimer with a variable name that contains the line number, so several timers can be used in the same scope, one per line. Because name is still compiled in Release, a variable used only as the name does not cause an unused variable warning.