Back to main.

Calmcode Shorts

htop logohtop


You can find more info about the htop project on their documentation page.

If you're on a mac you can install the tool via;

brew install htop

On many linux distributions you should be able to install it via;

apt-get install htop


The file in this video has the following contents.

import sys
import random

if __name__ == "__main__":
    _ = [random.random() for i in range(500_000)]
    print(f"these are the input settings: {sys.argv}")

This file can be run with 12 parallel works or 4.

seq 200 | parallel -j 4 python
seq 200 | parallel -j 12 python

To see the effect this has on your machines resources you can run htop.


Note that if you'd like to see more frequent updates, you can run this command instead:

htop --delay 2

Running htop with a lower delay parameter will cause it to also use more resources, but you should see more frequent updates.

Back to main.