Skip to content

Instantly share code, notes, and snippets.

@porfirion
Created February 15, 2016 21:40
Show Gist options
  • Save porfirion/73608ab27aacd19d3f89 to your computer and use it in GitHub Desktop.
Save porfirion/73608ab27aacd19d3f89 to your computer and use it in GitHub Desktop.
package main
import ("fmt"; "time")
func main() {
var distance float64 = 10.0
var speed float64 = 3.0
val := distance / speed * 1000000000
duration := time.Duration(val)
fmt.Printf("%#v (%T)\n", val, val)
fmt.Printf("%#v (%T)\n", duration, duration)
fmt.Printf("%#v (%T)\n", duration.Seconds(), duration.Seconds())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment