Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (11 sloc) 301 Bytes
#[macro_use]
extern crate neon;
extern crate num_cpus;
use neon::vm::{Call, JsResult};
use neon::js::JsNumber;
fn threading_hint(call: Call) -> JsResult<JsNumber> {
Ok(JsNumber::new(call.scope, num_cpus::get() as f64))
}
register_module!(m, {
m.export("threading_hint", threading_hint)
});