January 2019
Intermediate to advanced
384 pages
11h 50m
English
Sometimes, the simplest thing we can do is just to add some printfs reporting times spend in critical parts of the code as debug outputs (that is, they will disappear in your Release build). This is the simplest form of manual instrumentation we can have—no sophisticated output formats; just simple human-readable log lines.
We can use it in two ways: first, when investigating some incumbent performance problem, and, second, for an overview of the general timing of our application when it is evolving.
Qt can support us in that endeavor because it provides a C++ class that can be used to measure short-time intervals—the QElapsedTimer class. We can use it like this:
QElapsedTimer timer;timer.start();// work, work ... qDebug() ...
Read now
Unlock full access