Loading...
Searching...
No Matches
2#ifndef GRAMODS_CORE_RUNLIMITED
3#define GRAMODS_CORE_RUNLIMITED
28#define GM_RUNLIMITED(CODE, SECONDS) \
30 static std::chrono::steady_clock::time_point _gramods_last_executed; \
31 std::chrono::steady_clock::time_point _gramods_now = std::chrono::steady_clock::now(); \
32 if (_gramods_now - _gramods_last_executed > std::chrono::seconds(SECONDS)) { \
33 _gramods_last_executed = _gramods_now; \
38#define GM_RUNLIMITED_BEGIN(SECONDS) \
40 static bool _gramods_executed = false; \
41 if (!_gramods_executed) { \
42 _gramods_executed = true;
44#define GM_RUNLIMITED_END }}