You have to use a Frame that you put a OnUpdate script to do the calling for you.
For example;
Code:
local f = CreateFrame("Frame")
local count = 0
f:SetScript("OnUpdate", function(self, elapsed)
count = count + elapsed
if count >= 100 then
count = 0 -- reset to we wait another 100ms before printing
print("We do this each 100ms.")
end
end)
There are many other ways too, using the animation system and even the lua threading I reckon, but I am not so god with threading in lua. You can also look up the widget API here:
http://wowprogramming.com/docs