FPS계산

Unity3D 2012. 8. 1. 15:23
반응형

ltaTime = time/frame
1/deltaTime = frame/time

FPS = 1/deltaTime

That is for instantaneous FPS which is very volatile. What I do is make a moving average something like this:

float smoothFPS = 30f;
const float SMOOTHING_FACTOR = 0.9f;

// update
smoothFPS = smoothFPS * SMOOTHING_FACTOR + ((1.0f/Time.deltaTime) * (1.0f - SMOOTHING_FACTOR));



반응형
: