github.com/ericlagergren/ctb@v0.0.0-20220810041818-96749d9c394d/dudect/rdtsc.go (about) 1 package dudect 2 3 import _ "unsafe" // for go:linkname 4 5 /* 6 Intel actually recommends calling CPUID to serialize the execution flow 7 and reduce variance in measurement due to out-of-order execution. 8 We don't do that here yet. 9 see ยง3.2.1 http://www.intel.com/content/www/us/en/embedded/training/ia-32-ia-64-benchmark-code-execution-paper.html 10 */ 11 func cpucycles() int64 12 13 //go:linkname cpucycles runtime.cputicks