Skip to content

Instantly share code, notes, and snippets.

@jessicah jessicah/getcpuspeed.cpp Secret
Created May 18, 2014

Embed
What would you like to do?
cpu_topology_node_info *topology;
system_info systemInfo;
uint32_t count = 1;
get_system_info(&systemInfo);
get_cpu_topology_info(NULL, &count);
topology = new cpu_topology_node_info[count];
get_cpu_topology_info(topology, count);
for (uint32 i = 0; i < count; i++) {
if (topology[i].type == B_TOPOLOGY_CORE) {
cpu_clock_speed = topology[i].data.core.default_frequency;
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.