Thread Tools Display Modes
04/08/17, 07:24 AM   #1
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
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.

Last edited by Letho : 04/08/17 at 08:17 AM.
  Reply With Quote
04/08/17, 08:46 AM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
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.

Last edited by votan : 04/08/17 at 08:55 AM.
  Reply With Quote
04/08/17, 01:41 PM   #3
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
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
  Reply With Quote
04/08/17, 01:52 PM   #4
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Letho View Post
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.

Last edited by votan : 04/08/17 at 02:30 PM.
  Reply With Quote
04/08/17, 02:42 PM   #5
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
Damn, that sounds complicated. Is there any literature around rendering frames or did you find that out by testing?
  Reply With Quote
04/08/17, 02:49 PM   #6
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Letho View Post
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".
  Reply With Quote
04/08/17, 03:16 PM   #7
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
Aaaah that sums it up pretty well, so GameTimeMilliseconds is the way to go for me, thx a lot
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » GetFrameTimeSeconds, GetGameTimeMilliseconds

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off