diff options
| author | Russ Cox <rsc@golang.org> | 2023-08-10 11:56:53 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2023-08-11 15:26:40 +0000 |
| commit | 446783960277251fcb837f3672f377469d204918 (patch) | |
| tree | d1aee4b5dc659b0265565acfd974e7d08699413c /src/cmd/compile/internal/deadcode/deadcode.go | |
| parent | 8870b8d2817dc90da96ce6cfb767034d12965252 (diff) | |
| download | go-446783960277251fcb837f3672f377469d204918.tar.xz | |
time: make time.Since a few nanoseconds faster
time.Since(base) is an idiom that can be used to read the system
monotonic time as efficiently as possible, when that matters.
The current code structure adds a few nanoseconds on top of
the 15-20ns the time read already takes. Remove those few.
After this CL, there is no reason at all for anyone to
//go:linkname runtime.nanotime1 instead.
Came up while investigating #61765.
Change-Id: Ic9e688af039babfc2a5a8e67dcbb02847a5eb686
Reviewed-on: https://go-review.googlesource.com/c/go/+/518336
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Diffstat (limited to 'src/cmd/compile/internal/deadcode/deadcode.go')
0 files changed, 0 insertions, 0 deletions
