#includeIn this example, we create a QTime instance and start the timer. Then we do some time-consuming operations (a loop with 100 million iterations). After that, we call restart to get the elapsed time and print it using qDebug. The package library for Qt is qt5-base.#include int main() { QTime timer; timer.start(); // do some time-consuming operations for (int i = 0; i < 100000000; ++i) { // do nothing } qInfo() << "Elapsed time:" << timer.restart() << "ms"; return 0; }