OSDN Git Service

drop QTime methods that have QElapsedTimer equivalent
authorIvailo Monev <xakepa10@gmail.com>
Wed, 7 Jun 2023 10:25:38 +0000 (13:25 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 7 Jun 2023 10:25:38 +0000 (13:25 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/tools/qdatetime.cpp
src/core/tools/qdatetime.h

index c2df757..1a8e352 100644 (file)
@@ -1771,76 +1771,6 @@ bool QTime::isValid(int h, int m, int s, int ms)
 }
 
 
-/*!
-    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
  *****************************************************************************/
index b5881d1..b465cb8 100644 (file)
@@ -146,10 +146,6 @@ public:
 #endif
     static bool isValid(int h, int m, int s, int ms = 0);
 
-    void start();
-    int restart();
-    int elapsed() const;
-
 private:
     enum TimeFlag { NullTime = -1 };
     inline int ds() const { return mds == NullTime ? 0 : mds; }