Skip to content

Commit

Permalink
Update FPSCounter.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie-coder authored Dec 22, 2024
1 parent d805b56 commit fce8420
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions source/debug/FPSCounter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class FPSCounter extends TextField
/**
The current memory usage (WARNING: this is NOT your total program memory usage, rather it shows the garbage collector memory)
**/
public var memory(get, never):Float;
public var memory(get, never):Float;
inline function get_memory():Float
return Memory.gay();

var mempeak:Float = 0;
var mempeak:Float = 0;

@:noCompletion private var times:Array<Float>;

Expand All @@ -39,11 +39,11 @@ class FPSCounter extends TextField
times = [];
}

var timeColor:Float = 0.0;
var timeColor:Float = 0.0;

var fpsMultiplier:Float = 1.0;
var deltaTimeout:Float = 0.0;
public var timeoutDelay:Float = 500;
var deltaTimeout:Float = 0.0;
public var timeoutDelay:Float = 50;
// Event Handlers
override function __enterFrame(deltaTime:Float):Void
{
Expand All @@ -61,10 +61,10 @@ class FPSCounter extends TextField
}
else fpsMultiplier = 1.0;

if (memory > mempeak) mempeak = memory;

currentFPS = Math.min(FlxG.drawFramerate, times.length) / fpsMultiplier;
updateText();
if (memory > mempeak) mempeak = memory;
currentFPS = Math.min(FlxG.drawFramerate, times.length) / fpsMultiplier;
updateText();

if (ClientPrefs.rainbowFPS)
{
Expand Down Expand Up @@ -100,4 +100,4 @@ class FPSCounter extends TextField
text += "\nSystem: " + '${System.platformLabel} ${System.platformVersion}';
}
}
}
}

0 comments on commit fce8420

Please sign in to comment.