libzed 1.9.9
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
cpu.cpp
#include <iostream>
#include <z/system/cpuid.hpp>
int main() {
z::system::cpuid hardware;
("CPU vendor: "_zs + hardware.vendor()).writeln(std::cout);
("Thread count: "_zs + hardware.cpus()).writeln(std::cout);
("Logical cores: "_zs + hardware.cores()).writeln(std::cout);
return 0;
}
A class for easily getting CPU info.
Definition cpuid.hpp:10
const core::string< ascii > & vendor() noexcept
Get the CPU vendor.
int cpus() noexcept
Get the number of CPUs.
int cores() noexcept
Get the number of cores.