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

Method update

examples/Fx/FxNoiseRing/simple_timer.h:42–52  ·  view source on GitHub ↗

* @brief Update the timer state based on current time * * Checks if the timer is still running based on the current time. * If the specified duration has elapsed, the timer will stop. * * @param now Current time in milliseconds (typically from millis()) * @return true if the timer is still running, false if stopped or elapsed */

Source from the content-addressed store, hash-verified

40 * @return true if the timer is still running, false if stopped or elapsed
41 */
42 bool update(uint32_t now) {
43 if (!running) {
44 return false;
45 }
46 uint32_t elapsed = now - start_time;
47 if (elapsed > duration) {
48 running = false;
49 return false;
50 }
51 return true;
52 }
53
54 private:
55 uint32_t start_time; // When the timer was started (in milliseconds)

Callers 7

loopFunction · 0.45
loopFunction · 0.45
loopFunction · 0.45
loopFunction · 0.45
loopFunction · 0.45
loopFunction · 0.45
unit_testFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected