Last active
December 5, 2017 04:36
-
-
Save SafeteeWoW/7a4a63770870af06717830d871619242 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local requestTime = {} | |
local frame = _G.TestGetItemInfo or CreateFrame("Frame", "TestGetItemInfo") | |
frame:RegisterEvent("GET_ITEM_INFO_RECEIVED") | |
frame:SetScript("OnEvent", function(self, event, id) | |
if requestTime[id] then | |
print(format("%d", (GetTime()-requestTime[id])*1000) .. " ms", " ", id) --Time between request and receive" | |
end | |
end) | |
local function TestGetItemInfo() | |
local id = 0 | |
while not GetItemInfoInstant(id) do | |
id = math.random(1, 200000) | |
end | |
requestTime[id] = GetTime() | |
GetItemInfo(id) | |
C_Timer.After(1, TestGetItemInfo) -- Repeat every 1s | |
end | |
TestGetItemInfo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment