On Fri, Feb 15, 2019 at 12:49 PM Hemant Singh <hemanti...@gmail.com> 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 nanoseconds in int64. So this should work: rate=1.0/double(dur) The result would be in 1/nsecs > > thanks, > > Hemant > > -- > 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. -- 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.