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
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
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
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
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.
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"