Skip to content

Commit

Permalink
ddtrace/tracer: don't use UTC() when getting time (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanj committed Mar 8, 2022
1 parent c47da55 commit 5b43087
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ddtrace/tracer/time.go
Expand Up @@ -3,13 +3,14 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016 Datadog, Inc.

//go:build !windows
// +build !windows

package tracer

import "time"

// now returns current UTC time in nanos.
// now returns the current UNIX time in nanoseconds, as computed by Time.UnixNano().
func now() int64 {
return time.Now().UTC().UnixNano()
return time.Now().UnixNano()
}
2 changes: 1 addition & 1 deletion ddtrace/tracer/time_windows.go
Expand Up @@ -23,7 +23,7 @@ func highPrecisionNow() int64 {
}

func lowPrecisionNow() int64 {
return time.Now().UTC().UnixNano()
return time.Now().UnixNano()
}

var now func() int64
Expand Down

0 comments on commit 5b43087

Please sign in to comment.