Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i test how long something takes?

How do i test how long something takes?

like

for i = 1, 100, -1
	-- codes
end

print() -- prints how much long it took for i to finish

1 comment

0

There’s a function called tick, which can do this

1 answer

✓ Accepted answer

Check the difference in tick from before and after you run the loop:

local StartTick = tick()
for i = 1, 100, -1
    -- codes
end

print(tick() - StartTick) -- prints how much long it took for i to finish

I explain how this works better here.

1 comment

0

thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.