I want to monitor the CPUs' usage when a program is running. I came out with the idea, that htop has the CPU usage information on the top. I wonder if I can somehow run htop, make it refresh every 0.1 second, and output the information about CPU usage to a file. Does anyone have an idea how to achieve that? Any help would be deeply appreciated.