Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddtrace/tracer: don't use UTC() when getting time #1134

Merged
merged 3 commits into from Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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