- Qt 5.15
- Qt Core
- C++ Classes
- QTime
- Qt 5.15.18 Reference Documentation

# Obsolete Members for QTime

The following members of class QTime are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

## Public Functions

`(obsolete)` int | elapsed() const
`(obsolete)` void | start()

## Member Function Documentation

### int QTime::elapsed() const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

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.

Warning: 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-saving time is turned on or off.

See also start() and restart().

### void QTime::start()

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Sets this time to the current time. This is practical for timing:

     QTime t;
     t.start();
     some_lengthy_task();
     qDebug("Time elapsed: %d ms", t.elapsed());

See also restart(), elapsed(), and currentTime().