}
-/*!
- Sets this time to the current time. This is practical for timing:
-
- \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 10
-
- \sa restart(), elapsed(), currentTime()
-*/
-
-void QTime::start()
-{
- *this = currentTime();
-}
-
-/*!
- Sets this time to the current time and returns the number of
- milliseconds that have elapsed since the last time start() or
- restart() was called.
-
- This function is guaranteed to be atomic and is thus very handy
- for repeated measurements. Call start() to start the first
- measurement, and restart() for each later measurement.
-
- Note that the counter wraps to zero 24 hours after the last call
- to start() or restart().
-
- \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 savings time is turned on
- or off.
-
- \sa start(), elapsed(), currentTime()
-*/
-
-int QTime::restart()
-{
- QTime t = currentTime();
- int n = msecsTo(t);
- if (n < 0) // passed midnight
- n += 86400*1000;
- *this = t;
- return n;
-}
-
-/*!
- 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 savings time is turned on
- or off.
-
- \sa start(), restart()
-*/
-
-int QTime::elapsed() const
-{
- int n = msecsTo(currentTime());
- if (n < 0) // passed midnight
- n += 86400 * 1000;
- return n;
-}
-
-
/*****************************************************************************
QDateTime member functions
*****************************************************************************/