Skip to content

Instantly share code, notes, and snippets.

@jaytaph
Created August 4, 2015 20:42
Show Gist options
  • Save jaytaph/cdd9107ea11204ba855b to your computer and use it in GitHub Desktop.
Save jaytaph/cdd9107ea11204ba855b to your computer and use it in GitHub Desktop.
➜ saffire git:(cpuid) cat test.sf
import io,cpu;
io.println("CPU Info:");
io.println(" Vendor: ", cpu.vendor());
io.println(" Vendor ID: ", cpu.vendorId());
io.println(" Brand: ", cpu.brand());
io.println(" Codename: ", cpu.codename());
io.println(" Family: ", cpu.family());
io.println(" Extended family: ", cpu.extendedFamily());
io.println(" Model: ", cpu.model());
io.println(" Extended model: ", cpu.extendedModel());
io.println(" Stepping: ", cpu.stepping());
io.println(" Cores: ", cpu.cores());
io.println(" Logical CPU count: ", cpu.logicalCpuCount());
io.println(" Total logical CPU count: ", cpu.totalLogicalCpuCount());
io.print(" Flags: ");
foreach (cpu.flags() as flag) {
io.print(flag, " ");
}
io.println();
➜ saffire git:(cpuid) sf test.sf
CPU Info:
Vendor: GenuineIntel
Vendor ID: 0
Brand: Intel(R) Core(TM) i7-2675QM CPU @ 2.20GHz
Codename: Sandy Bridge (Core i7)
Family: 6
Extended family: 6
Model: 10
Extended model: 42
Stepping: 7
Cores: 4
Logical CPU count: 4
Total logical CPU count: 4
Flags: fpu vme de pse tsc msr pae mce cx8 apic mtrr sep pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht pni ssse3 syscall xd rdtscp lm lahf_lm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment