refactor FpsCounter index increment

GitOrigin-RevId: f8c636747e4ab2cc8e99378e525ab2cde70cadb6
This commit is contained in:
Colin McMillen 2019-12-09 17:17:22 -05:00
parent 80b6e2ac5c
commit 524ed70b9d

View File

@ -17,10 +17,7 @@ namespace Jumpy {
fps = 1000.0 * frameTimes.Length / timeElapsed;
}
frameTimes[idx] = now;
idx++;
if (idx == frameTimes.Length) {
idx = 0;
}
idx = (idx + 1) % frameTimes.Length;
}
}
}