qint64 start,end;
start = QDateTime::currentMSecsSinceEpoch();
//!do something
end = QDateTime::currentMSecsSinceEpoch();
qDebug() << “用时(毫秒):” << end - start ;
QT中计算某块代码执行时间
于 2024-03-21 14:36:16 首次发布
qint64 start,end;
start = QDateTime::currentMSecsSinceEpoch();
//!do something
end = QDateTime::currentMSecsSinceEpoch();
qDebug() << “用时(毫秒):” << end - start ;