title: How to benchmark host multi-threaded CPU performance in Java?
body: <p>I need to create a simple Java app that returns just one number: estimated CPU performance. For example when I run it on machine with 4 cores I will roughly get twice as big number than if run with 2 cores. This app should use 100% CPU for several seconds to measure that. I'm really not worried about accuracy.</p>
  
  <p>I was really surprised that I couldn't find any Java library that already does that. Of course there are tools in other languages, but in my environment only Java is approved.</p>
  
  <p>My current idea is to use classes from <a href="https://math.nist.gov/scimark2/index.html" rel="nofollow noreferrer">SciMark 2.0</a> in my code and run it from multiple threads, however this tool looks very messy (e.g. class names beginning with lowercase letters) and I need to write custom code to run these threads and combine the results.</p>
  
  <p>Can I do any better to solve that problem?</p>