Changes

Jump to navigation Jump to search

timer.getMilliSecCounter

9 bytes added, 13:21, 25 May 2011
Line 31: Line 31:  
If you want to do something after ''60'' seconds, for example, here is what you have to do :
 
If you want to do something after ''60'' seconds, for example, here is what you have to do :
   −
<source>timeleft = 60-math.floor((math.abs(timer.getMilliSecCounter()) - math.abs(startTime))*0.001) -- startTime would be a variable defined earlier as '0', for instance.
+
<source>timeleft = 60-math.floor((math.abs(timer.getMilliSecCounter()) - math.abs(startTime))*0.001)
 +
-- startTime would be a variable defined earlier as '0', for instance.
 
if math.abs(math.floor(timeleft)) == 0 then
 
if math.abs(math.floor(timeleft)) == 0 then
 
  -- your code here --
 
  -- your code here --
end
+
end</source>
    
== See also  ==
 
== See also  ==

Navigation menu