From 0f57018a0b1c40bca247fabe49d01dc7291c3090 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 1 Jun 2019 19:33:24 +0000 Subject: [PATCH] Add an example displaying the current number of CPUs --- examples/values.rs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 examples/values.rs diff --git a/examples/values.rs b/examples/values.rs new file mode 100644 index 0000000..041cfaf --- /dev/null +++ b/examples/values.rs @@ -0,0 +1,6 @@ +extern crate num_cpus; + +fn main() { + println!("Logical CPUs: {}", num_cpus::get()); + println!("Physical CPUs: {}", num_cpus::get_physical()); +}