FrameTime()

After testing, FrameTime() does not appear to be the time to render the frame in respect to HUDPaint. HUDPaint is called either faster or slower, I forget. Is FrameTime() not supposed to essentially tell you the time between each calling of HUDPaint?

FrameTime is to be used for motion mainly. It has nothing to do with the HUD, it’s for frame rate compensation in general.

FrameTime is adjusted by host_timescale and Valve’s prediction. Use RealFrameTime.

So if I do:

[lua]local oldtime = SysTime()
hook.Add(“HUDPaint”,“CheckIntervals”,function()
print(SysTime()-oldtime,RealFrameTime())
oldtime = SysTime()
end)[/lua]

It should print the same value?

edit Tried that, clocked differenced from 0.001 to 0.009.

Maybe because that calculation is happening before the frame has stopped drawing.

How would you make it happen after the fact then?

1 / RealFrameTime() will give you the FPS.

I don’t understand why you need it so precise? Sure it’ll lag a frame behind, so what?