Speed Test by Ookla is a web service that
measures Internet connection performance metrics like download/upload rate, latency, and packet loss. The company offers a browser-based test, as well as several dedicated applications for the same, though you can bypass all of that with this snippet:

wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test100.zip

Here we ask wget to download a 100 MB zip file from Speed Test, and send the result to /dev/null, where it's immediately discarded. The results are conveyed in real-time to your terminal, e.g.:

--2021-11-21 10:40:00--  http://speedtest.wdc01.softlayer.com/downloads/test100.zip
Resolving speedtest.wdc01.softlayer.com (speedtest.wdc01.softlayer.com)... 169.54.48.218, 2607:f0d0:3006:154::3
Connecting to speedtest.wdc01.softlayer.com (speedtest.wdc01.softlayer.com)|169.54.48.218|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104874307 (100M) [application/zip]
Saving to: ‘/dev/null’

100%[====================================================================================================>] 104,874,307 72.5MB/s   in 1.4s 

2021-11-21 10:40:01 (72.5 MB/s) - ‘/dev/null’ saved [104874307/104874307]

Keep in mind that this command-line test only measures download speed, and the result is limited by the lower of the maximum speed the source/destination can offer. Also, it's useful to poll multiple sources, and run multiple tests. To perform the latter, you can do:

for run in {1..5}; wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test100.zip; done

which runs the test five (5) times sequentially.

For more information on Speed Test results, see here. Also, check out the command line application here.

Cheers.