View Single Post
04/29/14, 03:50 PM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
The OnUpdate handler has two returns - the frame and the time in seconds.

Lua Code:
  1. local timelastrun = 0
  2. myFrame:SetHandler("OnUpdate", function(self, timerun)
  3.     if (timerun - timelastrun) >= 1 then     --this will run the below code once every second
  4.         --do stuff
  5.         timelastrun = timerun
  6.     end
  7. end)
  Reply With Quote