m1cpu: initial commit of a package for inspecting apple silicon CPUs
8 files changed
tree: 543107eb41995a60b8554db5a3671771d0dd5e03
  1. cpu.go
  2. cpu_test.go
  3. go.mod
  4. go.sum
  5. incompatible.go
  6. LICENSE
  7. Makefile
  8. README.md
README.md

m1cpu

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.

Install

go get github.com/shoenig/m1cpu@latest

Example

package main

import (
    "fmt"

    "github.com/shoenig/go-m1cpu"
)

func main() {
    fmt.Println("pCore", m1cpu.PCoreGHz())
    fmt.Println("eCore", m1cpu.ECoreGHz())
}

License

Open source under the MPL