Codechange: introduce a framework for all our timers
IntervalTimer and TimeoutTimer use RAII, and can be used to replace all the time-based timeouts, lag-detection, "execute every N" we have. As it uses RAII, you can safely use it as static variable, class member, temporary variable, etc. As soon as it goes out-of-scope, it will be safely removed. This allows for much easier to read code when it comes to intervals.
This commit is contained in:

committed by
Patric Stout

parent
730687080a
commit
5e1bcee39b
@@ -155,6 +155,13 @@
|
||||
# define NOACCESS(args)
|
||||
#endif
|
||||
|
||||
/* [[nodiscard]] on constructors doesn't work in GCC older than 10.1. */
|
||||
#if __GNUC__ < 10 || (__GNUC__ == 10 && __GNUC_MINOR__ < 1)
|
||||
# define NODISCARD
|
||||
#else
|
||||
# define NODISCARD [[nodiscard]]
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__)
|
||||
# define NORETURN
|
||||
# define CDECL
|
||||
|
Reference in New Issue
Block a user