tinygo/testdata/timers.txt
Kenneth Bell 24b45555bd runtime: add support for time.NewTimer and time.NewTicker
This commit adds support for time.NewTimer and time.NewTicker. It also
adds support for the Stop() method on time.Timer, but doesn't (yet) add
support for the Reset() method.

The implementation has been carefully written so that programs that
don't use these timers will normally not see an increase in RAM or
binary size. None of the examples in the drivers repo change as a result
of this commit. This comes at the cost of slightly more complex code and
possibly slower execution of the timers when they are used.
2022-08-23 12:37:25 +02:00

11 строки
239 Б
Text

waiting on ticker
- after 80ms
waited on ticker at 160ms
- after 240ms
waited on ticker at 320ms
- after 400ms
ticker was stopped (didn't send anything after 400ms)
waiting on timer
- after 80ms
waited on timer at 160ms
- after 240ms