* If the ticking process has run amok (should be impossible), we * take care of this by "skipping" the in-between time, to prevent * a bazillion times from firing on accident. This has the result * that a drastic jump in time will continue acting normally. Users * may not expect this, but... I think it is the best solution. */
| 145 | * may not expect this, but... I think it is the best solution. |
| 146 | */ |
| 147 | inline double CalcNextThink(double last, float interval) |
| 148 | { |
| 149 | if (g_fUniversalTime - last - interval <= TIMER_MIN_ACCURACY) |
| 150 | { |
| 151 | return last + interval; |
| 152 | } |
| 153 | else |
| 154 | { |
| 155 | return g_fUniversalTime + interval; |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | void ITimer::Initialize(ITimedEvent *pCallbacks, float fInterval, float fToExec, void *pData, int flags) |
| 160 | { |