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

Is there a timer built into CC?

Started by Kenzo, 30 March 2016 - 09:22 AM
Kenzo #1
Posted 30 March 2016 - 11:22 AM
hi, im just wandering is there a timer already in CC?
and if so how do i use it?
Bomb Bloke #2
Posted 30 March 2016 - 11:35 AM
There are a few, actually. The two most important ones are os.startTimer() and os.clock().

The former fires an event after a specified time, which you can then pull. Most CC scripts perform their timing this way.

The latter gets you the number of seconds the system has been on for. Handy if you want to measure how long a given action took.