commit | 63855fe83ddd9defa3c1ed3aa9bc917c41d1e9ec | [log] [tgz] |
---|---|---|
author | Seth Hoenig <shoenig@duck.com> | Thu Mar 23 00:46:46 2023 -0500 |
committer | Seth Hoenig <shoenig@duck.com> | Thu Mar 23 00:46:46 2023 -0500 |
tree | b46ce57c694647da3bb16307a7f4276c32d33ded | |
parent | a4dcb176a15ee61c9b110340a0d950b2eb86470c [diff] |
ci: fixup macos runner type
The go-m1cpu
module 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/go-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