Os.clock
From ComputerCraft Wiki
Returns the amount of time the computer craft computer has been running, note that this may not be the amount of time the program has been running. the function os.clock() is useful for debugging, for example to see how long a custom function takes to execute use the following code:
x = os.clock() -- compensates for time already passed
myfunction() -- function to be tested
y = (os.clock() - x) -- calculates time change
print(y)