hello, i am new to everything is new in programming-heaven. old-c-guy. and i thought it`s time to learn something most-modern ..
time.NewTicker( time.Second ) ok time.NewTicker( 5 * time.Second ) ok var n int = 5 time.NewTicker( n * time.Second ) error : int * duration time.NewTicker( time.Duration(n) * time.Second ) ok : duration * duration [s^2] square-seconds ? tick := time.NewTicker( time.Duration( math.rand.Intn(10) ) * time.Second ) go func() { for { select { case <-done : return ,case tc := <-tick.C : **** tick **** }}}() this strategy gets the tick if it has already happend in past and this go-routine is active if it is suspended will it be notified as soon in either done or tick something is to read ? when i (later) write own code / interfaces / struct where inside is like in ticker the .C a channel, can i define something like an operator, so that the outer object acts like a channel type S struct { C chan time .. } s := S{C:make(chan time),..} s<- <-s -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/5c36344f-737e-4a50-b6e6-f3f48c49d42bn%40googlegroups.com.