Fix the calculateFPS function
This commit is contained in:
parent
ec5915a6f9
commit
b32f6ad476
|
@ -47,7 +47,7 @@ volatile int lastFramePosition = 0;
|
||||||
volatile int frames = 0;
|
volatile int frames = 0;
|
||||||
|
|
||||||
float calculateFPS (long timeLength, int frames) {
|
float calculateFPS (long timeLength, int frames) {
|
||||||
return (float) frames / (float) timeLength;
|
return 1000.0 / ((float) frames / (float) timeLength);
|
||||||
}
|
}
|
||||||
float calculateRPM (long rotationLength) {
|
float calculateRPM (long rotationLength) {
|
||||||
return 60000.0 / (float) (rotationLength);
|
return 60000.0 / (float) (rotationLength);
|
||||||
|
|
Loading…
Reference in New Issue