created a function to produce some pseudo load on a given number of cores