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