512 |
// The timeout has already fired or is about to. |
// The timeout has already fired or is about to. |
513 |
return 0; |
return 0; |
514 |
} |
} |
515 |
else if(diff > (100 * TimeSpan.TicksPerSecond)) |
else if (diff > (dpy.timerQueue.period * TimeSpan.TicksPerMillisecond)) |
516 |
|
{ |
517 |
|
// The next due time is farther away than the time period we're |
518 |
|
// supposed to wait. This propably means the system clock has |
519 |
|
// been turned back (either manually or by NTP). In this case |
520 |
|
// we must calculate a new due time and just return 0. |
521 |
|
dpy.timerQueue.nextDue = DateTime.UtcNow + new TimeSpan |
522 |
|
(dpy.timerQueue.period * TimeSpan.TicksPerMillisecond); |
523 |
|
return 0; |
524 |
|
} |
525 |
|
else if (diff > (100 * TimeSpan.TicksPerSecond)) |
526 |
{ |
{ |
527 |
// Don't wait more than 100 seconds at a time. |
// Don't wait more than 100 seconds at a time. |
528 |
return 100000; |
return 100000; |