MCPcopy Create free account
hub / github.com/0x1abin/MultiTimer / multiTimerYield

Function multiTimerYield

MultiTimer.c:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52int multiTimerYield(void) {
53 if (platformTicksFunction == NULL) {
54 return -1; // Indicate error if platformTicksFunction is NULL
55 }
56 uint64_t currentTicks = platformTicksFunction();
57 while (timerList && (currentTicks >= timerList->deadline)) {
58 MultiTimer* timer = timerList;
59 timerList = timer->next; // Remove expired timer
60
61 if (timer->callback) {
62 timer->callback(timer, timer->userData); // Execute callback
63 }
64 }
65 return timerList ? (int)(timerList->deadline - currentTicks) : 0;
66}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68