ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   What does the function GetFrameTimeMilliseconds() do? (https://www.esoui.com/forums/showthread.php?t=9214)

Gedalya 06/14/20 11:16 AM

What does the function GetFrameTimeMilliseconds() do?
 
I am new to writing addons. I have seen the following function in use in an existing addon:
GetFrameTimeMilliseconds()

It is not clear from context what it does; I also see no relevant information online. The Wiki for example has it listed among other functions but it lacks any annotation.

Thank you for your time.

Shinni 06/14/20 12:00 PM

There are two functions: GetGameTimeMilliseconds and GetFrameTimeMilliseconds.

GetGameTimeMilliseconds returns the number of milliseconds that passed since the game started, if I remember correctly.
It might also be since your login. Not entirely sure if it is since start or since login, but for most use cases it shouldn't matter, because it's usually used to get time differences.

GetFrameTimeMilliseconds is similar, it returns the number of milliseconds that have passed since the game started and the current frame started to render.
So when the game starts to render a frame, both functions return the same value, but if you have some code that runs for a few milliseconds, then GetGameTimeMilliseconds will return a larger number while GetFrameTimeMilliseconds still returns the same number.
For example if GetGameTimeMilliseconds() - GetFrameTimeMilliseconds() = 5, then it means 5 milliseconds have passed since the game started processing the current frame.

Gedalya 06/14/20 12:17 PM

Thank you!!!


All times are GMT -6. The time now is 12:58 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI