View Single Post
11-01-08, 01:05 AM   #2
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
1) you could store expirationTime in some variable, not to query it every time
2) or could do some thing like
bar:SetMinMaxValues(GetTime(),expirationTime)
when you initializing your timer and then just put bar:SetValue(GetTime()) in OnUpdate and you don't even need to store anything
3) you could limit amount of OnUpdate calls, but here it's unnecessary, onupdate func is very small already

This can't be the best way to do this right? Like there is some sort of built in thing-a-ma-jig that does times and durations for you?
no, for something involving time updating it's the only way.
Try to use AceTimer lib, but that's the same onupdate in more friendly way
  Reply With Quote