Standard library / time

time.Duration.Milliseconds()

Return whole milliseconds, discarding the remainder toward zero. Expected stdout: '1\n'.

Formal Syntax & Structure

go syntaxgo
func (d Duration) Milliseconds() int64

Return Value

int64

Return whole milliseconds, discarding the remainder toward zero.

Working Example

Example Snippetgo
package main
import (  "fmt"  "time")
func main() { fmt.Println((1500 * time.Microsecond).Milliseconds()) }
Go Reference