Skip to content

Commit

Permalink
chore: add basic example (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Apr 5, 2024
1 parent 7e02e4f commit 3c5fe8f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/basic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
fn main() -> Result<(), archspec::cpu::UnsupportedMicroarchitecture> {
let architecture = archspec::cpu::host()?;

println!("Current CPU architecture:");
println!("- Name: {}", architecture.name());
println!("- Vendor: {}", architecture.vendor());
println!("- Generation: {}", architecture.generation());
println!("- Family Name: {}", architecture.family().name());
println!("- Features: {:?}", architecture.all_features());

Ok(())
}

0 comments on commit 3c5fe8f

Please sign in to comment.