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

How to set stopwatch and put how long in a varible

Started by houseofkraft, 31 August 2016 - 09:17 PM
houseofkraft #1
Posted 31 August 2016 - 11:17 PM
So i want to make a program that will ping one of my CC PC's

and i want to make a stopwatch on how long it takes and save it to a varible

Thank You!
KingofGamesYami #2
Posted 31 August 2016 - 11:44 PM
What do you mean by "ping"? If you mean rednet / modem stuff, it's basically instantaneous. However, you'll want to use os.clock for timing things. It returns the current time the computer has been running, so if you call it before and after and do a subtract, you can get the elapsed time.
houseofkraft #3
Posted 01 September 2016 - 12:46 AM
Thank you for your help! And also i am trying to make a rednet ping to see if my CC Servers are up and running :)/>