📄 classptimer.html
字号:
</tr></table><a name="z457_2" doxytag="PTimer::operator="></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> PTimer& PTimer::operator= </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">DWORD </td> <td class="mdname1" valign="top" nowrap> <em>milliseconds</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Restart the timer in one shot mode using the specified time value. If the timer was already running, the "time left" is simply reset.<p><dl compact><dt><b>Returns: </b></dt><dd> reference to the timer. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>milliseconds</em> </td><td>New time interval for timer. </td></tr></table></dl> </td> </tr></table><a name="z459_4" doxytag="PTimer::Pause"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void PTimer::Pause </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Pause a running timer. This differs from the <a class="el" href="classPTimer.html#z459_2">Stop()</a># function in that the timer may be resumed at the point that it left off. That is time is "frozen" while the timer is paused. </td> </tr></table><a name="z459_7" doxytag="PTimer::Reset"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void PTimer::Reset </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Restart a timer continuing from the time it was initially. </td> </tr></table><a name="z463_1" doxytag="PTimer::Resolution"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> unsigned PTimer::Resolution </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the smallest number of milliseconds that the timer can be set to. All actual timing events will be rounded up to the next value. This is typically the platforms internal timing units used in the <a class="el" href="classPTimer.html#z463_0">Tick()</a># function.<p><dl compact><dt><b>Returns: </b></dt><dd> minimum number of milliseconds per timer "tick". </dl> </td> </tr></table><a name="z459_5" doxytag="PTimer::Resume"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void PTimer::Resume </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Restart a paused timer continuing at the time it was paused. The time left at the moment the timer was paused is the time until the next call to the notification function. </td> </tr></table><a name="z459_1" doxytag="PTimer::RunContinuous"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void PTimer::RunContinuous </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPTimeInterval.html">PTimeInterval</a> & </td> <td class="mdname1" valign="top" nowrap> <em>time</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Start a timer in continous cycle mode. Whenever the timer runs out it is automatically reset to the time specified. Thus, it calls the notification function every time interval. </td> </tr></table><a name="z459_0" doxytag="PTimer::SetInterval"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual void PTimer::SetInterval </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">PInt64 </td> <td class="mdname" nowrap> <em>milliseconds</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>long </td> <td class="mdname" nowrap> <em>seconds</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>long </td> <td class="mdname" nowrap> <em>minutes</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>long </td> <td class="mdname" nowrap> <em>hours</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>days</em> = 0</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set the value of the time interval. The time interval, in milliseconds, is the sum of all of the parameters. For example all of the following are equivalent: \begin{verbatim} SetInterval(120000) SetInterval(60000, 60) SetInterval(60000, 0, 1) SetInterval(0, 60, 1) SetInterval(0, 0, 2) \end{verbatim} <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>seconds</em> </td><td>Number of milliseconds for interval. </td></tr><tr><td valign=top><em>minutes</em> </td><td>Number of seconds for interval. </td></tr><tr><td valign=top><em>hours</em> </td><td>Number of minutes for interval. </td></tr><tr><td valign=top><em>days</em> </td><td>Number of hours for interval. Number of days for interval. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPTimeInterval.html#z451_6">PTimeInterval</a>. </td> </tr></table><a name="z461_2" doxytag="PTimer::SetNotifier"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> PINLINE void PTimer::SetNotifier </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPNotifier.html">PNotifier</a> & </td> <td class="mdname1" valign="top" nowrap> <em>func</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set the call back function that is called whenever the timer expires. This is called by the <a class="el" href="classPTimer.html#z461_0">OnTimeout()</a># function. </td> </tr></table><a name="z459_2" doxytag="PTimer::Stop"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void PTimer::Stop </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Stop a running timer. The imer will not call the notification function and is reset back to the original timer value. Thus when the timer is restarted it begins again from the beginning. </td> </tr></table><a name="z463_0" doxytag="PTimer::Tick"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classPTimeInterval.html">PTimeInterval</a> PTimer::Tick </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the number of milliseconds since some arbtrary point in time. This is a platform dependent function that yields a real time counter.<p>Note that even though this function returns milliseconds, the value may jump in minimum quanta according the platforms timer system, eg under MS-DOS and MS-Windows the values jump by 55 every 55 milliseconds. The <a class="el" href="classPTimer.html#z463_1">Resolution()</a># function may be used to determine what the minimum time interval is.<p><dl compact><dt><b>Returns: </b></dt><dd> millisecond counter. </dl> </td> </tr></table><hr><h2>Friends And Related Function Documentation</h2><a name="l0" doxytag="PTimer::PTimerList"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> friend class PTimerList<code> [friend]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="timer_8h-source.html">timer.h</a><li><a class="el" href="osutil_8inl.html">osutil.inl</a></ul><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:20 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -