1. 程式人生 > >Qt計算兩個時間差

Qt計算兩個時間差

clas class nbsp pan mil debug 時間差 int col

 QTime startTime = QTime::currentTime();
    QThread::msleep(SLEEP_TIME_MILL);
    QTime stopTime = QTime::currentTime();
    int elapsed = startTime.msecsTo(stopTime);
    qDebug()<<"QTime.currentTime ="<<elapsed<<"ms";

Qt計算兩個時間差