Obsolete Members for QTime

以下成员源于类 QTime 已过时。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共函数

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

成员函数文档编制

int QTime:: elapsed () const

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

Returns the number of milliseconds that have elapsed since the last time start () 或 restart () 被调用。

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 () 或 restart () was called, the result is undefined. This can happen when daylight-saving time is turned on or off.

另请参阅 start () 和 restart ().

void QTime:: start ()

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

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());
					

另请参阅 restart (), elapsed (),和 currentTime ().