Skip to content

Instantly share code, notes, and snippets.

View alan-andrade's full-sized avatar
💻

Alan Andrade alan-andrade

💻
View GitHub Profile
anonymous
anonymous / gist:11201423
Created April 23, 2014 02:55
cpus
extern crate libc;
macro_rules! trace(
($($arg:tt)*) => (
{ let x = ::std::io::stdout().write_line(format_args!(::std::fmt::format, $($arg)*)); println!("{}", x); }
);
)
pub fn num_cpus() -> uint {
unsafe {