MACRO
OMNI_SLEEP_INIT
- A helper macro for initializing sleep variables
SYNOPSIS top
To enable millisecond sleep capabilities cross-platform, temporaries are needed on non-Windows platforms.
To enable millisecond sleep capabilities cross-platform, temporaries are needed on non-Windows platforms.
DESCRIPTION top
To enable millisecond sleep capabilities cross-platform, temporaries are needed on non-Windows platforms; to this, when
Example:
In this example,
To enable millisecond sleep capabilities cross-platform, temporaries are needed on non-Windows platforms; to this, when
omni::sync::sleep
is called, this macro is utilized. As well, in other areas of the library where a sleep is called in a tight loop, this macro is utilized.Example:
OMNI_SLEEP_INIT(); while (dorun) { OMNI_SLEEP(1000); // 1s sleep }
OMNI_SLEEP_INIT
is an empty macro on Windows platforms and the sleep variables needed on others.
CONSIDERATIONS top
Since
Since
omni::sync::sleep
calls this macro and OMNI_SLEEP
it might be less costly to just directly call this macro and OMNI_SLEEP
or OMNI_SLEEP1
if the sleep is called in a tight loop (i.e. <1-2ms/iteration).