Time measurement


#1

Hello.

How I can to measure time of executing my function?

Thanks.


#2
!ms_real1: 0.0
!s1: 0
!ms_real2: 0.0
!s2: 0

GameLib.accurate_real_time(@@world, s1, ms_real1)
_wait(2.0)
GameLib.accurate_real_time(@@world, s2, ms_real2)

!s: s2 - s1
!ms: ms_real2 - ms_real1
println(s " " ms)

#3

Yes - GameLib.accurate_real_time() should do the trick. That is the UE4 call that we’ve been using.

It is a bit cumbersome, though you could wrap it in a custom method to help simplify it.


#4

I might get it wrong but I found that _wait_until() does not work as expected in PIE mode, the timer that used by _wait_until (if there is one) should reset on every play (PIE).


#5

This is a bug, I’ve reproduced it locally, thanks for reporting.