#include #include #include #include void test(); int main() { QTime timer; timer.start(); QFuture future = QtConcurrent::run(timer, &QTime::elapsed); qDebug() << "First run: " << future.result(); timer.restart(); QFuture future2 = QtConcurrent::run(timer, &QTime::elapsed); qDebug() << "Second run: " << future2.result(); }