Skip to content

Commit

Permalink
fix: use QElapsedTimer instead of QTime (#296)
Browse files Browse the repository at this point in the history
Fix the following warning in main.cpp:

‘void QTime::start()’ is deprecated: Use QElapsedTimer instead [-Wdeprecated-declarations]
   33 |     useTime.start();
  • Loading branch information
felixonmars authored Sep 21, 2023
1 parent 04b6414 commit 58ddbb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <QDebug>
#include <QCommandLineParser>
#include <QTranslator>
#include <QTime>
#include <QElapsedTimer>

DWIDGET_USE_NAMESPACE

Expand All @@ -29,7 +29,7 @@ DCORE_USE_NAMESPACE
int main(int argc, char *argv[])
{
// 应用计时
QTime useTime;
QElapsedTimer useTime;
useTime.start();
//为了更精准,起动就度量时间
qint64 startTime = QDateTime::currentDateTime().toMSecsSinceEpoch();
Expand Down

0 comments on commit 58ddbb5

Please sign in to comment.