Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (20 sloc) 346 Bytes
package main
import (
var duration time.Duration
func init() {
flag.DurationVar(&duration, "duration", time.Millisecond, "how long to sleep")
func main() {
for {
start := time.Now()
timer := time.NewTimer(duration)
end := time.Now()
fmt.Println(end.Sub(start) - duration)
You can’t perform that action at this time.