FastLED 3.9.15
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1#pragma once
2
45
46#include "fl/namespace.h"
47#include "fl/int.h"
48
49#ifdef FASTLED_TESTING
50#include "fl/function.h"
51#endif
52
53namespace fl {
54
97fl::u32 time();
98
99#ifdef FASTLED_TESTING
100
102using time_provider_t = fl::function<fl::u32()>;
103
126void inject_time_provider(const time_provider_t& provider);
127
136void clear_time_provider();
137
159class MockTimeProvider {
160public:
163 explicit MockTimeProvider(fl::u32 initial_time = 0);
164
167 void advance(fl::u32 milliseconds);
168
171 void set_time(fl::u32 milliseconds);
172
175 fl::u32 current_time() const;
176
179 fl::u32 operator()() const;
180
181private:
182 fl::u32 mCurrentTime;
183};
184
185#endif // FASTLED_TESTING
186
187} // namespace fl
Implements the FastLED namespace macros.
fl::u32 time()
Universal millisecond timer - returns milliseconds since system startup.
Definition time.cpp:136
IMPORTANT!
Definition crgb.h:20