03.11.2022, 07:09
You can test download speed like this. But most likely the result will be lower than the available network bandwidth.
Code:
require('socket.http')
ts, tu = os.microtime()
data = socket.http.request('http://speed.transip.nl/10mb.bin')
time = os.udifftime(ts, tu)
speed = string.format('%.2f MB/s', 10 / time)
log(speed)