Get per-core CPU usage in terminal in machine-readable format
There are ways to get this information from htop, but they basically involve screen scraping, as it is designed primarily for interactive use.
Instead, check out the glances command-line tool, which can do what you want.
It can be installed via homebrew:
brew install glances
Something like the following may work for you:
glances --stdout now,percpu --time 10