mirror of
https://github.com/golang/go
synced 2024-11-19 13:04:45 -07:00
66bfbd9ad7
change hash/crc32 package to use cpu package instead of using runtime internal variables to check crc32 instruction Change-Id: I8f88d2351bde8ed4e256f9adf822a08b9a00f532 Reviewed-on: https://go-review.googlesource.com/76490 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
14 lines
469 B
Go
14 lines
469 B
Go
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package runtime
|
|
|
|
//go:nosplit
|
|
func cputicks() int64 {
|
|
// Currently cputicks() is used in blocking profiler and to seed runtime·fastrand().
|
|
// runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
|
|
// TODO: need more entropy to better seed fastrand.
|
|
return nanotime()
|
|
}
|