Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1033685 // RollingFPSCounter - produces a new value every second and averages over 5 seconds [dev.]

JavaX fragment (include)

sclass RollingFPSCounter extends FPSCounter {
  RollingAverage pastSeconds = new(5);
  
  synchronized void inc() {
    if (elapsedSeconds() >= 1)
      FPSCounter
    counter++;
  }

  synchronized double get() {
    ret pastSeconds!;
  }
}

Author comment

Began life as a copy of #1033433

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033685
Snippet name: RollingFPSCounter - produces a new value every second and averages over 5 seconds [dev.]
Eternal ID of this version: #1033685/1
Text MD5: 17fa0602df5a633cdee4e492764a3d7a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-12-26 22:26:59
Source code size: 253 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 127 / 158
Referenced in: [show references]