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

Method checkTimeout

src/fl/test/fltest.cpp.hpp:302–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302bool TestContext::checkTimeout() FL_NOEXCEPT {
303 if (!mGetMillis || mDefaultTimeoutMs == 0) {
304 return false; // No timeout configured
305 }
306
307 fl::u32 now = mGetMillis();
308 fl::u32 elapsed = now - mCurrentTestStartMs;
309
310 if (elapsed > mDefaultTimeoutMs) {
311 mCurrentTestTimedOut = true;
312
313 // Call timeout handler if set
314 if (mTimeoutHandler) {
315 mTimeoutHandler(mCurrentTestName ? mCurrentTestName : "unknown", elapsed);
316 } else {
317 // Default behavior: print timeout message
318 fl::printf(" [TIMEOUT] Test exceeded %u ms (elapsed: %u ms)\n",
319 mDefaultTimeoutMs, elapsed);
320 }
321 return true;
322 }
323 return false;
324}
325
326fl::u32 TestContext::getElapsedMs() const FL_NOEXCEPT {
327 if (!mGetMillis) {

Callers

nothing calls this directly

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected