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

Function millis

src/platforms/wasm/timer.cpp.hpp:89–100  ·  view source on GitHub ↗

Replacement for 'millis' in WebAssembly context

Source from the content-addressed store, hash-verified

87
88// Replacement for 'millis' in WebAssembly context
89EMSCRIPTEN_KEEPALIVE fl::u32 millis() {
90 double elapsed_ms = get_time_since_epoch();
91
92 // Handle potential overflow - Arduino millis() wraps around every ~49.7 days
93 // This matches Arduino behavior where millis() overflows back to 0
94 if (elapsed_ms >= fl::numeric_limits<fl::u32>::max()) {
95 elapsed_ms = fmod(elapsed_ms, fl::numeric_limits<fl::u32>::max());
96 }
97
98 fl::u32 result = fl::u32(elapsed_ms);
99 return result;
100}
101
102// Replacement for 'micros' in WebAssembly context
103EMSCRIPTEN_KEEPALIVE fl::u32 micros() {

Callers 9

getStripUpdateDataFunction · 0.70
getUiUpdateDataFunction · 0.70
showPixelsMethod · 0.70
showPixelsMethod · 0.70
updateMethod · 0.50
showPixelsMethod · 0.50
time_stub.cpp.hppFile · 0.50
ClocklessControllerClass · 0.50
CoroutineRunnerImplClass · 0.50

Calls 4

get_time_since_epochFunction · 0.85
maxFunction · 0.85
fmodFunction · 0.85
u32Enum · 0.50

Tested by

no test coverage detected