Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-17 Thread Ian Lance Taylor
On Wed, Jun 17, 2020 at 7:24 AM Konstantin Khomoutov wrote: > > On Wed, Jun 10, 2020 at 04:03:36PM -0700, Ian Lance Taylor wrote: > > [...] > > In the current implementations of Go, Tickers are not garbage > > collected. They run until they are stopped. So if you don't stop a > > ticker, it will

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-17 Thread Konstantin Khomoutov
On Wed, Jun 10, 2020 at 04:03:36PM -0700, Ian Lance Taylor wrote: [...] > In the current implementations of Go, Tickers are not garbage > collected. They run until they are stopped. So if you don't stop a > ticker, it will keep ticking until your program exits. > > (It is possible that future i

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread Curtis Paul
It sure does...thanks again :) On Wednesday, June 10, 2020 at 5:34:23 PM UTC-6, andrey mirtchovski wrote: > > > Cool, makes sense. Assuming NewTicker does return monotonic time. > > > > I wonder if there is a way to verify. > > just fmt.Println the value you receive on the ticker chan, you'll

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread andrey mirtchovski
> Cool, makes sense. Assuming NewTicker does return monotonic time. > > I wonder if there is a way to verify. just fmt.Println the value you receive on the ticker chan, you'll see the monotonic component tacked on in the end: $ cat t.go package main import ( "fmt" "time" ) func main() {

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread Curtis Paul
Cool, makes sense. Assuming NewTicker does return monotonic time. I wonder if there is a way to verify. On Wednesday, June 10, 2020 at 5:04:24 PM UTC-6, Ian Lance Taylor wrote: > > On Wed, Jun 10, 2020 at 3:48 PM Curtis Paul > wrote: > > > > It sounds like NewTicker will dynamically adjust to

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread Curtis Paul
Ya, I didn't see anything specific in that part of the doc regarding NewTicker and monotonic. I did see that some things in time. do not consider monotonic clock. Then the blurb on NewTicker didn't say anything about monotonic. I guess it's safe to assume NewTicker returns a monotonic clock tim

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread Ian Lance Taylor
On Wed, Jun 10, 2020 at 3:48 PM Curtis Paul wrote: > > It sounds like NewTicker will dynamically adjust to keep tick time "accurate". > > Does anyone know if the time data that NewTicker returns (i.e. via it's > channel, etc...) includes monotonic time? > And if so is the definition of NewTicker

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread andrey mirtchovski
> Does anyone know if the time data that NewTicker returns (i.e. via it's > channel, etc...) includes monotonic time? it's right at the top: https://golang.org/pkg/time/ On Wed, Jun 10, 2020 at 4:48 PM Curtis Paul wrote: > > It sounds like NewTicker will dynamically adjust to keep tick time "ac

[go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread Curtis Paul
It sounds like NewTicker will dynamically adjust to keep tick time "accurate". Does anyone know if the time data that NewTicker returns (i.e. via it's channel, etc...) includes monotonic time? And if so is the definition of NewTicker referring to adjusting real time clock or monotonic clock? I