MCPcopy Create free account
hub / github.com/FastLED/FastLED / countFPS

Method countFPS

src/FastLED.cpp.hpp:490–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488extern int noise_max;
489
490void CFastLED::countFPS(int nFrames) {
491 static int br = 0;
492 static fl::u32 lastframe = 0; // fl::millis();
493
494 if(br++ >= nFrames) {
495 fl::u32 now = fl::millis();
496 now -= lastframe;
497 if(now == 0) {
498 now = 1; // prevent division by zero below
499 }
500 mNFPS = (br * 1000) / now;
501 br = 0;
502 lastframe = fl::millis();
503 }
504}
505
506void CFastLED::setMaxRefreshRate(fl::u16 refresh, bool constrain) {
507 if(constrain) {

Callers

nothing calls this directly

Calls 1

millisFunction · 0.70

Tested by

no test coverage detected