Determine number of cores using Rust

There’s a crate to do this: num_cpus.

References:

  • crates.io page

  • github.com source

Add this to your Cargo.toml:

[dependencies]
num_cpus = "1.0"

Then in your source:

extern crate num_cpus;
let num = num_cpus::get();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)