2 ms·
It's even worse. The longTimer has fired, and it sent a message on the channel just as it was supposed to. When Reset() is called, it causes a second firing and
by kevhito 10y ago
It's even worse. The longTimer has fired, and it sent a message on the channel just as it was supposed to. When Reset() is called, it causes a second firing and a second message. Here is the code, corrected to illustrate. The output times are exactly as one would expect.
https://play.golang.org/p/lntgH6tkiF https://play.golang.org/p/lntgH6tkiF