Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What is "clock" for?

Asked by
Wutras 294 Moderation Voter
8 years ago

As some of you may have noticed already, there is a keyword called clock and this seems to have no use. I have researched it on ROBLOX wiki, but found out nothing. Is there any way of how to use it or is it even doing something? I thought it may be standing in relation to time or os.time. Maybe it's a Lua keyword that was deactivated when converting it to rblx.lua? I've got no clue and would really much appreciate any help.

0
good question Perci1 4988 — 8y
0
Thanks. It really bothers me. Wutras 294 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

First I'd like to state that clock is not a keyword. Disappointingly whatever ROBLOX uses to color their code puts special variables and functions with the keywords list. Words like os, floor, and table are not Lua keywords, but words like while, end, and not are keywords.

I found what clock refers to is os.clock, which is disabled in ROBLOX but is in normal Lua. This page tells that os.clock returns the number of seconds of CPU time for the program.

0
Thank you very much, it bothered me a long time already. Wutras 294 — 8y
Ad

Answer this question