github.com/xaionaro-go/rand@v0.0.0-20191005105903-aba1befc54a5/mathrand/uint64_amd64.go (about)

     1  //+build amd64
     2  
     3  package mathrand
     4  
     5  import (
     6  	_ "unsafe"
     7  )
     8  
     9  //go:linkname runtime_cputicks runtime.cputicks
    10  func runtime_cputicks() int64
    11  
    12  // Uint64CpuTicks returns current value of ticks count on AMD64 CPU
    13  func (prng *PRNG) Uint64CpuTicks() uint64 {
    14  	return uint64(runtime_cputicks())
    15  }