local _,ns = ...

local frame = CreateFrame("Frame",nil, UIParent)

local UpdateInterval = 1.0

local updateFrames

frame.TimeSinceLastUpdate = 0
local function OnUpdateTimer(self, elapsed)
    --local time = GetTimePreciseSec()
    self.TimeSinceLastUpdate = self.TimeSinceLastUpdate + elapsed
    if (self.TimeSinceLastUpdate < UpdateInterval) then
        return
    end
    self.TimeSinceLastUpdate = 0
    ns.updateCombatFrame()
    ns.partyTimerKillBreakRestTick() -- includes isrunning
    --print("total exec time: ",(GetTimePreciseSec()-time)*1000)
end


local timerRunning = false
function ns.timerStart()
    timerRunning = true
    frame:SetScript("OnUpdate", OnUpdateTimer)
end

function ns.timerStop()
    frame:SetScript("OnUpdate", nil)
    timerRunning = false
end

function ns.getTimerRunning()
    return timerRunning
end