Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Hemant Singh
Thanks all. I figured it out too, but using sprintf and strconv.Atoi. Best. Hemant On Friday, February 15, 2019 at 3:19:38 PM UTC-5, Burak Serdar wrote: > > On Fri, Feb 15, 2019 at 1:15 PM Sam Whited > wrote: > > > > On Fri, Feb 15, 2019, at 20:00, Burak Serdar wrote: > > > rate=1.0/double(d

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Burak Serdar
On Fri, Feb 15, 2019 at 1:15 PM Sam Whited wrote: > > On Fri, Feb 15, 2019, at 20:00, Burak Serdar wrote: > > rate=1.0/double(dur) > > nit: s/double/float64/ oops. Thanks for the correction. > > —Sam > > -- > You received this message because you are subscribed to the Google Groups > "golang-n

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Sam Whited
On Fri, Feb 15, 2019, at 20:00, Burak Serdar wrote: > rate=1.0/double(dur) nit: s/double/float64/ —Sam -- 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-nu

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Burak Serdar
On Fri, Feb 15, 2019 at 12:49 PM Hemant Singh wrote: > > This is an example of time.Duration I have: 5.671msec > > I need to convert the duration to rate = 1.0/5.671 msec. > > However, time.Duration and float in 1.0 do not mix. How do I get the rate? According to the docs, Duration is nanosecond

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Michael Jones
start := time.Now() : // work to be timed : elapsed := time.Now().Sub(start).Seconds() hertz := 1.0/elapsed On Fri, Feb 15, 2019 at 11:49 AM Hemant Singh wrote: > This is an example of time.Duration I have: 5.671msec > > I need to convert the duration to rate = 1.0/5.671 msec. > > However, time.

[go-nuts] inverse of time.Duration?

2019-02-15 Thread Hemant Singh
This is an example of time.Duration I have: 5.671msec I need to convert the duration to rate = 1.0/5.671 msec. However, time.Duration and float in 1.0 do not mix. How do I get the rate? thanks, Hemant -- You received this message because you are subscribed to the Google Groups "golang-nuts"