mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 11:13:27 +00:00
skip calling ticks when the sleep queue is empty
This commit is contained in:
@@ -226,10 +226,13 @@ func addSleepTask(t *task, duration int64) {
|
|||||||
// Run the scheduler until all tasks have finished.
|
// Run the scheduler until all tasks have finished.
|
||||||
func scheduler() {
|
func scheduler() {
|
||||||
// Main scheduler loop.
|
// Main scheduler loop.
|
||||||
|
var now timeUnit
|
||||||
for {
|
for {
|
||||||
scheduleLog("")
|
scheduleLog("")
|
||||||
scheduleLog(" schedule")
|
scheduleLog(" schedule")
|
||||||
now := ticks()
|
if sleepQueue != nil {
|
||||||
|
now = ticks()
|
||||||
|
}
|
||||||
|
|
||||||
// Add tasks that are done sleeping to the end of the runqueue so they
|
// Add tasks that are done sleeping to the end of the runqueue so they
|
||||||
// will be executed soon.
|
// will be executed soon.
|
||||||
|
|||||||
Reference in New Issue
Block a user