Standard library / time

time.Second

One second equals 1000000000 nanoseconds. Multiply an integer converted to Duration by this unit; check overflow for large inputs. Expected stdout: '1000000000\n'.

Formal Syntax & Structure

go syntaxgo
const Second Duration = 1000000000

Working Example

Example Snippetgo
package main
import (  "fmt"  "time")
func main() { fmt.Println(time.Second.Nanoseconds()) }
Go Reference