FastLED 3.10.8
Loading...
Searching...
No Matches

◆ micros64()

fl::u64 fl::micros64 ( )

64-bit monotonic microsecond timer.

Extends the platform's 32-bit microsecond counter using unsigned elapsed deltas, so the returned value never wraps in practical use.

Definition at line 127 of file chrono.cpp.hpp.

127 {
128 Micros64State& state = get_micros64_state();
129 fl::unique_lock<fl::mutex> lock(state.mutex);
130 const fl::u32 current = fl::micros();
131 if (!state.initialized) {
132 state.accumulated = current;
133 state.last_micros = current;
134 state.initialized = true;
135 return state.accumulated;
136 }
137 state.accumulated += static_cast<fl::u32>(current - state.last_micros);
138 state.last_micros = current;
139 return state.accumulated;
140}
TestState state
fl::u32 micros() FL_NO_EXCEPT
Universal microsecond timer - returns microseconds since system startup.

References FL_NO_EXCEPT, micros(), and state.

Referenced by fl::chrono::steady_clock::now(), and fl::chrono::system_clock::now().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: