Skip to main content

cpus_for

Function cpus_for 

Source
pub fn cpus_for(count: usize) -> usize
Expand description

How many processes music21 runs at once on a machine with this many processors: one fewer than there are, leaving one free, from three up.

use music21::common::parallel::cpus_for;

assert_eq!(cpus_for(8), 7);
assert_eq!(cpus_for(2), 2);