internal: use time.Since instead of time.Now().Sub

Change-Id: I536c7fad84a63e96658c6930a5a77fd70edca33c
Reviewed-on: https://go-review.googlesource.com/c/go/+/436718
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
This commit is contained in:
cuiweixie 2022-09-29 21:45:51 +08:00 committed by Gopher Robot
parent b8ed88db8d
commit daf1612dc7

View file

@ -792,7 +792,7 @@ func (ws *workerServer) fuzz(ctx context.Context, args fuzzArgs) (resp fuzzRespo
func (ws *workerServer) minimize(ctx context.Context, args minimizeArgs) (resp minimizeResponse) {
start := time.Now()
defer func() { resp.Duration = time.Now().Sub(start) }()
defer func() { resp.Duration = time.Since(start) }()
mem := <-ws.memMu
defer func() { ws.memMu <- mem }()
vals, err := unmarshalCorpusFile(mem.valueCopy())