|
|
|
|
|
by BeefWellington
1369 days ago
|
|
Not really, that's just the most basic way to think of scheduling. The usual way to avoid this in a big loop is a notifier thread that looks at when it next needs to wake and then sleeps for an interval just shorter than that time. Due to clock errors and accounting for thread wake wonkiness IME it's usually a good idea to have this "loop" fire in a bit of a window around when the event needs to happen (say +/- 25ms, YMMV) and then trigger the event only at the specified time. After triggering the event repeat sleeping until the next scheduled event. |
|