
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.
11 строки
239 Б
Text
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
|