Question about ZApplication.Time
Moderator: Moderators
Question about ZApplication.Time
I tried to use ZApplication.Time to measure duration of computation of a code in one ZExpression. The duration was always 0, so the value of ZApplication.Time did not change even during several seconds of computation. Is ZApplication.Time updated only once in update-render cycle? How to solve my problem of measuring duration of execution? I would like to avoid calling of Win32 routines or adding additional Timer components. Cannot, e.g., the ZApplication.Time be updated each time the program asks for its value?
Re: Question about ZApplication.Time
Hi Rado,
K
Yes, it is updated once per frame ( would be a waste of cycles if it was updated more often ).Rado1 wrote:I tried to use ZApplication.Time to measure duration of computation of a code in one ZExpression. The duration was always 0, so the value of ZApplication.Time did not change even during several seconds of computation. Is ZApplication.Time updated only once in update-render cycle?
What do you need this for? If you're trying to throttle steams depending on the users' CPU, you could do a ( multi-frame ) speed test on start-up and then use that result for the rest of the game.Rado1 wrote:How to solve my problem of measuring duration of execution? I would like to avoid calling of Win32 routines or adding additional Timer components.
K
Re: Question about ZApplication.Time
Hi Kjell,
I wanted to know exact speed of loading and processing OBJ files as part of algorithm optimization discussed in this thread. Anyway, I did a workaround and printing the loading time in a next cycle (which is not very nice because I need another variable); see my next version of the obj loader in that thread coming soon.Kjell wrote:What do you need this for?
Ah,
For benchmarking i usually just execute alternative solutions X* amount of time ( in a single frame ) and compare the framerate. As long as the overhead of the loop is identical for both this is a good way to determine which is faster.
*A amount that causes the framerate of one solution to be around 20 or so. Depending on what you're testing this can be 10 or 1.000.000 times.
K
For benchmarking i usually just execute alternative solutions X* amount of time ( in a single frame ) and compare the framerate. As long as the overhead of the loop is identical for both this is a good way to determine which is faster.
*A amount that causes the framerate of one solution to be around 20 or so. Depending on what you're testing this can be 10 or 1.000.000 times.
K