diff --git a/builder/sizes_test.go b/builder/sizes_test.go index 8184040648..f4274708da 100644 --- a/builder/sizes_test.go +++ b/builder/sizes_test.go @@ -42,9 +42,9 @@ func TestBinarySize(t *testing.T) { // This is a small number of very diverse targets that we want to test. tests := []sizeTest{ // microcontrollers - {"hifive1b", "examples/echo", 4556, 280, 0, 2264}, - {"microbit", "examples/serial", 2920, 388, 8, 2272}, - {"wioterminal", "examples/pininterrupt", 7379, 1489, 116, 6912}, + {"hifive1b", "examples/echo", 4580, 280, 0, 2264}, + {"microbit", "examples/serial", 2928, 388, 8, 2272}, + {"wioterminal", "examples/pininterrupt", 7387, 1489, 116, 6912}, // TODO: also check wasm. Right now this is difficult, because // wasm binaries are run through wasm-opt and therefore the diff --git a/src/runtime/scheduler_cooperative.go b/src/runtime/scheduler_cooperative.go index bf6f5aec49..274daa84d5 100644 --- a/src/runtime/scheduler_cooperative.go +++ b/src/runtime/scheduler_cooperative.go @@ -77,7 +77,6 @@ func addSleepTask(t *task.Task, duration timeUnit) { panic("runtime: addSleepTask: expected next task to be nil") } } - t.Data = uint64(duration) now := ticks() if sleepQueue == nil { scheduleLog(" -> sleep new queue") @@ -85,6 +84,7 @@ func addSleepTask(t *task.Task, duration timeUnit) { // set new base time sleepQueueBaseTime = now } + t.Data = uint64(duration + (now - sleepQueueBaseTime)) // Add to sleep queue. q := &sleepQueue