Get Nanoseconds in Duration
Examples in
Go
Nanoseconds returns the duration as an integer nanosecond count.
package main
import (
"fmt"
"time"
)
func main() {
u, _ := time.ParseDuration("1µs")
fmt.Printf("One microsecond is %d nanoseconds.\n", u.Nanoseconds())
}