Is there a mock program that uses the CPU on multiple cores?

I am playing around with htop, gprof, etc. I’d like a program that basically just runs on multiple cores so I can profile it and learn how to use these tools. I know I can write my own c++ code with -fopenmp and run a useless loop, but I was hoping there’s a stock unix command I can use?

Basically I just want a program that uses 100% of however many cores I tell it, until I ask it to stop. Does this exist?

Asked By: quant


Not stock, but here are a few tool I have used before:

Answered By: Brian McManus
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.