commit | 28fc1accc2818a0df072874616cd3d4a8f327213 | [log] [tgz] |
---|---|---|
author | Seth Hoenig <shoenig@duck.com> | Thu Mar 23 00:31:46 2023 -0500 |
committer | Seth Hoenig <shoenig@duck.com> | Thu Mar 23 00:31:46 2023 -0500 |
tree | b3981ee47914f5ae238f52b5af8e91bc6513a523 | |
parent | 5d99bb4e5256de227be6fc3831984d5bf5ab3785 [diff] |
m1cpu: add CGO build tags and document in README
The m1cpu
package is a library for inspecting Apple Silicon CPUs in Go.
Use the m1cpu
library for looking up the CPU frequency for Apple M1 and M2 CPUs.
go get github.com/shoenig/m1cpu@latest
package main
import (
"fmt"
"github.com/shoenig/go-m1cpu"
)
func main() {
fmt.Println("pCore", m1cpu.PCoreGHz())
fmt.Println("eCore", m1cpu.ECoreGHz())
}
This package requires the use of CGO. Extracting the CPU properties is done via Apple's IOKit framework, which is accessible only through system C libraries.
Open source under the MPL