This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TableCraft0R's profile picture

Speed Test

Started by TableCraft0R, 24 July 2013 - 07:58 AM
TableCraft0R #1
Posted 24 July 2013 - 09:58 AM
SpeedTest

CODE
Spoiler


function as()
–7.54
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.blue)
term.setBackgroundColor(colors.lime)
term.write(" Speedtest. Need30mb free space.Enable HTTP API. ")
term.setCursorPos(1,19)
term.write("COPYLEFT TABLECRAFT0R 2013 ALL WRONGS SEND TO ME. ")
term.setBackgroundColor(colors.lightBlue)
term.setTextColor(colors.gray)
term.setCursorPos(1,2)
term.write("Test Size A:239kb B:1,7mb C:7.54mb D:30mb: ")
term.setCursorPos(44,2)
ax = read()
if ax=="A" then
term.setCursorPos(1,3)
term.write("[INFO] Downloading 239kb of Random Data ")
–random ! ! !

apk = os.clock()
get = http.get("http://cebu.smart.com.ph/speedtest/random350x350.jpg")
apk2s = os.clock()
tmp = fs.open("TMP","w")
tmp.write(get.readAll())
tmp.close()
get.close()
term.setCursorPos(1,3)
term.write("[INFO] Downloaded 0.239 mb of data in " .. apk2s - apk .. " seconds. ")
fs.delete("TMP")
elseif ax=="B" then
term.setCursorPos(1,3)
term.write("[INFO] Downloading 1.39 MB Of Random Data ")
–random ! ! !

apk = os.clock()
get = http.get("http://cebu.smart.com.ph/speedtest/random1000x1000.jpg")
apk2s = os.clock()
tmp = fs.open("TMP","w")
tmp.write(get.readAll())
tmp.close()
get.close()
term.setCursorPos(1,3)
term.write("[INFO] Downloaded 1.39mb of data in " .. apk2s - apk .. " seconds. ")
fs.delete("TMP")
elseif ax=="C" then
term.setCursorPos(1,3)
term.write("[INFO] Downloading 7.59MB Of Random Data ")
–random ! ! !

apk = os.clock()
get = http.get("http://cebu.smart.com.ph/speedtest/random2000x2000.jpg")
apk2s = os.clock()
tmp = fs.open("TMP","w")
tmp.write(get.readAll())
tmp.close()
get.close()
term.setCursorPos(1,3)
term.write("[INFO] Downloaded 7.59mb of data in " .. apk2s - apk .. " seconds. ")
fs.delete("TMP")
elseif ax=="D" then
term.setCursorPos(1,3)
term.write("[INFO] Downloading 30MB Of Random Data ")
–random ! ! !

apk = os.clock()
get = http.get("http://cebu.smart.com.ph/speedtest/random4000x4000.jpg")
apk2s = os.clock()
tmp = fs.open("TMP","w")
tmp.write(get.readAll())
tmp.close()
get.close()
term.setCursorPos(1,3)
term.write("[INFO] Downloaded 30 mb of data in " .. apk2s - apk .. " seconds. ")
fs.delete("TMP")

else
print("ERROR. USE CAPITAL/NO CHOICE")
end
end
as()

I
Bored. So i created this. Ignore if Boring
jesusthekiller #2
Posted 24 July 2013 - 12:12 PM
What kind of "random" shieet is it? It just downloads plain JPEG file…
Mitchfizz05 #3
Posted 25 July 2013 - 05:27 PM
What kind of "random" shieet is it? It just downloads plain JPEG file…
I think the idea is that it sees how long it takes for the JPEG file to download, not the usual upload/download speed in Mbps.
Really though it is still a perfectly functional speed tester.
However, it probably shouldn't download, like, 40 MB of data, we'll probably get the message by then. ;)/>
dersaw #4
Posted 22 October 2013 - 03:23 AM
Nice information.


I am using 5 Mbps connection.
My Internet Speed test results are
Download Speed:4.031Mbps(0.25MBps)
Upload Speed :1.854Mbps(0.11MBps)
I got these accurate results from Scanmyspeed.com in normal scan.
Dave-ee Jones #5
Posted 31 October 2013 - 05:29 AM
Lol. Effective way to test your internet speed.
But I think you will find out when you start the program anyway, as it is downloading like 40mb of data…Not the best idea if you want to find out exactly how slow your slow internet is. Other than that, smart thinking.