Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

int QTime::elapsed (  )  const

Returns the number of milliseconds that have elapsed since the last time start() or restart() was called.

Note that the counter wraps to zero 24 hours after the last call to start() or restart.

Note that the accuracy depends on the accuracy of the underlying operating system; not all systems provide 1-millisecond accuracy.

If the system's clock setting has been changed since the last time start() or restart() was called, the result is undefined. This can happen when daylight savings time is turned on or off.
See also:
start(), restart()

Definition at line 1822 of file qdatetime.cpp.

References currentTime(), and msecsTo().

Referenced by QX11EmbedContainer::embedClient(), QWorkspace::eventFilter(), QGraphicsView::paintEvent(), QEventLoop::processEvents(), QCoreApplication::processEvents(), QTest::qWait(), QSslSocket::waitForBytesWritten(), QProcess::waitForBytesWritten(), QAbstractSocket::waitForBytesWritten(), QAbstractSocket::waitForConnected(), QAbstractSocket::waitForDisconnected(), QSslSocket::waitForEncrypted(), QProcess::waitForFinished(), QAbstractSocket::waitForReadyRead(), and QSslSocket::waitForReadyRead().

    int n = msecsTo(currentTime());
    if (n < 0)                                // passed midnight
        n += 86400 * 1000;
    return n;

Generated by  Doxygen 1.6.0   Back to index