Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --time = os.time() print("time= ", time)
- clockTime = os.clock()
- print("clockTime: ", clockTime, ", minutes: ", clockTime / 60)
- fakeTime = 33.4567
- function displayTime(time)
- --print("time = ", time)
- rawSeconds = math.floor(time)
- rawMinutes = math.floor(rawSeconds/60)
- hours = math.floor(rawMinutes/60)
- seconds = rawSeconds - (rawMinutes * 60)
- minutes = rawMinutes - (hours * 60)
- -- print("Raw: ", hours, "h ", rawMinutes, "m ", rawSeconds, "s")
- -- print(hours, "h ", minutes, "m ", seconds, "s")
- timeString = "Elapsed time: "
- hStr = " hrs "
- mStr = " mins "
- sStr = " secs"
- if hours == 1 then hStr = " hr " end
- if minutes == 1 then mStr = " min " end
- if seconds == 1 then sStr = " sec " end
- if hours > 0 then
- timeString = timeString .. hours .. hStr
- end
- if minutes > 0 then
- timeString = timeString .. minutes .. mStr
- end
- if seconds > 0 then
- timeString = timeString .. seconds .. sStr
- end
- print(timeString)
- end
- --[[
- formattedTime = textutils.formatTime(timeNumber, true)
- print("formattedTime: ", formattedTime)
- elapsedTime = 12.706 - 11.637
- print("elapsedTime: ", textutils.formatTime(elapsedTime, true))
- --]]
- --print("Elapsed time: ")
- --displayTime(915432.4567)
- print("Time since last reboot:")
- displayTime(clockTime)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement