Logic Machine Forum
Internet speed test - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: Internet speed test (/showthread.php?tid=4343)



Internet speed test - Dario - 02.11.2022

Hi,
is it possible with a LUA script, make a internet speed test?
Thanks


RE: Internet speed test - admin - 03.11.2022

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)