ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   GetFrameTimeSeconds, GetGameTimeMilliseconds (https://www.esoui.com/forums/showthread.php?t=6951)

Letho 04/08/17 07:24 AM

GetFrameTimeSeconds, GetGameTimeMilliseconds
 
Hey guys, I was wondering in how far those two functions differ from each other except for returning different time formats (ms and s) and why they are not listed in the Wiki.

Can anybody help with those questions?

And from an coding elegance/performance PoV: which one should I use when manually checking on effect/buff/debuff durations?

The existance of both provide some inconsistency in my addons since GetAbilityDuration() will return values comparable against GameTimeMs while EVENT_EFFECT_CHANGED returns `endTime` in FrameTimeSeconds, of course I could convert them.

votan 04/08/17 08:46 AM

There is also GetFrameTimeMilliseconds()
GetFrameTimeMilliseconds() gives a timestamp in milliseconds, where the frame your Lua code currently runs for, started to render. It keeps the value until all Lua is done. While GetGameTimeMilliseconds() is continous even within the frame.
=> GetGameTimeMilliseconds()>=GetFrameTimeMilliseconds().

If you need time quantized to the frame use GetFrameTimeMilliseconds().

Even if GetGameTimeMilliseconds()-GetFrameTimeMilliseconds() >= 2000, the user has not seen it, because the screen has freezed. ;)

Letho 04/08/17 01:41 PM

Thx for the answer, though I am afraid I don't know enough about how stuff is rendered, just know about scripting :/

What do u mean by "until all lua is done"? Let's say I just log in, addons just finished initializing. Shouldn't FrameTime start from 0 if it works the way you described it?

And what do you mean by "continous"? Continous from what?

Cheers,
Letho

votan 04/08/17 01:52 PM

Quote:

Originally Posted by Letho (Post 30512)
Thx for the answer, though I am afraid I don't know enough about how stuff is rendered, just know about scripting :/

What do u mean by "until all lua is done"? Let's say I just log in, addons just finished initializing. Shouldn't FrameTime start from 0 if it works the way you described it?

And what do you mean by "continous"? Continous from what?

Cheers,
Letho

If you do something which takes "long" >16ms or much more, you prevent the game from rendering frames. So you either have to finish within 16ms or suspend and resume yourself.

"continous" in time.


/edit: And I think it is something like time since starting the eso executable.

Letho 04/08/17 02:42 PM

Damn, that sounds complicated. Is there any literature around rendering frames or did you find that out by testing?

votan 04/08/17 02:49 PM

Quote:

Originally Posted by Letho (Post 30514)
Damn, that sounds complicated. Is there any literature around rendering frames or did you find that out by testing?

Don't worry too much about rendering. :)
Yes, just try it out yourself.
All you need to know is: GetFrameTimeMilliseconds() is a timestamp, while GetGameTimeMilliseconds() is the always updated "now".

Letho 04/08/17 03:16 PM

Aaaah that sums it up pretty well, so GameTimeMilliseconds is the way to go for me, thx a lot :)


All times are GMT -6. The time now is 11:27 AM.

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