This works great, thank you! And with minimal changes to my existing code (that's why I didn't like so much the other proposals that use time.After or time.Timer, but thanks anyway!).
Am Mittwoch, 31. August 2016 16:06:58 UTC+2 schrieb Marvin Renich: > > > Does this do what you want? > > https://play.golang.org/p/302HPhYn89 > > With the current code, t.C can be passed around, but SetDuration must > always be called from the same goroutine. With a little work (and a > mutex) you could make SetDuration safe for concurrent use. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.