{"id":17925951,"url":"https://github.com/shoenig/go-m1cpu","last_synced_at":"2025-03-24T03:31:16.695Z","repository":{"id":150972121,"uuid":"617790669","full_name":"shoenig/go-m1cpu","owner":"shoenig","description":"Library for inspecting Apple Silicon CPUs in Go ","archived":false,"fork":false,"pushed_at":"2024-05-01T12:02:49.000Z","size":33,"stargazers_count":10,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-19T01:41:39.095Z","etag":null,"topics":["apple","cpu","ghz","go","golang","library","m1","m2","mac","macos","mhz","osx","performance","speed"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shoenig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-23T05:39:07.000Z","updated_at":"2024-09-30T09:27:59.000Z","dependencies_parsed_at":"2023-11-06T14:58:49.081Z","dependency_job_id":null,"html_url":"https://github.com/shoenig/go-m1cpu","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoenig%2Fgo-m1cpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoenig%2Fgo-m1cpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoenig%2Fgo-m1cpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoenig%2Fgo-m1cpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shoenig","download_url":"https://codeload.github.com/shoenig/go-m1cpu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245204544,"owners_count":20577370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","cpu","ghz","go","golang","library","m1","m2","mac","macos","mhz","osx","performance","speed"],"created_at":"2024-10-28T20:58:31.534Z","updated_at":"2025-03-24T03:31:16.209Z","avatar_url":"https://github.com/shoenig.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# m1cpu\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/shoenig/go-m1cpu.svg)](https://pkg.go.dev/github.com/shoenig/go-m1cpu)\n[![MPL License](https://img.shields.io/github/license/shoenig/go-m1cpu?color=g\u0026style=flat-square)](https://github.com/shoenig/go-m1cpu/blob/main/LICENSE)\n[![Run CI Tests](https://github.com/shoenig/go-m1cpu/actions/workflows/ci.yaml/badge.svg)](https://github.com/shoenig/go-m1cpu/actions/workflows/ci.yaml)\n\nThe `go-m1cpu` module is a library for inspecting Apple Silicon CPUs in Go.\n\nUse the `m1cpu` Go package for looking up the CPU frequency for Apple M1 and M2 CPUs.\n\n# Install\n\n```shell\ngo get github.com/shoenig/go-m1cpu@latest\n```\n\n# CGO\n\nThis package requires the use of [CGO](https://go.dev/blog/cgo).\n\nExtracting the CPU properties is done via Apple's [IOKit](https://developer.apple.com/documentation/iokit?language=objc)\nframework, which is accessible only through system C libraries.\n\n# Example\n\nSimple Go program to print Apple Silicon M1/M2 CPU speeds.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/shoenig/go-m1cpu\"\n)\n\nfunc main() {\n\tfmt.Println(\"Apple Silicon\", m1cpu.IsAppleSilicon())\n\n\tfmt.Println(\"pCore GHz\", m1cpu.PCoreGHz())\n\tfmt.Println(\"eCore GHz\", m1cpu.ECoreGHz())\n\n\tfmt.Println(\"pCore Hz\", m1cpu.PCoreHz())\n\tfmt.Println(\"eCore Hz\", m1cpu.ECoreHz())\n}\n```\n\nUsing `go test` to print out available information.\n\n```\n➜ go test -v -run Show\n=== RUN   Test_Show\n    cpu_test.go:42: pCore Hz 3504000000\n    cpu_test.go:43: eCore Hz 2424000000\n    cpu_test.go:44: pCore GHz 3.504\n    cpu_test.go:45: eCore GHz 2.424\n    cpu_test.go:46: pCore count 8\n    cpu_test.go:47: eCoreCount 4\n    cpu_test.go:50: pCore Caches 196608 131072 16777216\n    cpu_test.go:53: eCore Caches 131072 65536 4194304\n--- PASS: Test_Show (0.00s)\n```\n\n# License\n\nOpen source under the [MPL](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoenig%2Fgo-m1cpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshoenig%2Fgo-m1cpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoenig%2Fgo-m1cpu/lists"}