When I want to get a duration in milliseconds with sub-millisecond
precision, I currently have to do:
d := time.Since(start)
msec := d.Seconds() * float64(time.Second/time.Millisecond)
My other option is to use the Nanoseconds() method that return an int64,
convert to float64 and then scale.
I'd like to introduce two methods Microseconds() and Milliseconds() that
// Microseconds returns the duration as a floating point number of
func (d *duration) Microseconds() float64
// Milliseconds returns the duration as a floating point number of
func (d *duration) Milliseconds() float64
There are already Microsecond and Millisecond constants, and method to
convert a Duration to all the other exported multipliers (Nanosecond,
Second, Minute, Hour). I think we should at least provide them by symmetry.
What do people think of my suggestion? If nobody objects, I'd probably
write the method and send the code for review.