Alternative to QElapsedTimer in old Qt version
Hi,
I would like to run some simple benchmarks on an embedded device with an architecture that does not support valgrind.
For my purposes, something like the the QElapsedTimer would be sufficient, unfortunately, the Qt version on the device is too old, and cannot be upgraded easily.
What would be a viable alternative to using QElapsedTimer that would work with Qt 4.6.3 ?
Thanks!
Re: Alternative to QElapsedTimer in old Qt version
You could use QTime with msecsTo().
Re: Alternative to QElapsedTimer in old Qt version
Re: Alternative to QElapsedTimer in old Qt version
the right pattern seems to be:
#if (QT_VERSION < QT_VERSION_CHECK(4, 7, 0))
# include <QTime>
typedef QTime QElapsedTimer;
#else
# include <QElapsedTimer>
#endif