It's not really an "internet speed" test, MYRKRISH1005, but is does provide delay/latency and "number of hops" (sort of how many "switches" were traversed).
I simply use:
ping internet.address
Where "internet.address" is the name of the server you wish to ping (like www.apple.com ).
If you want to do anything "fancier" consult the "man" page:
man ping
(Incidentally. I use this command, now and then, as a simple way of checking for Domain Name Service [DNS] issues: it will tell me that the host name is unknown, if there's a DNS issue. [Yes. There are more direct means, but I simply keep this command in my Terminal history, as a simple check.])
It will continuously ping, until you type ^C (control-c).