macro_time - Get macro time
int32 macro_time();
Get the time as the number of milli-seconds the macro file is running or recording since initiated by macro_run
or macro_rec
.
Returns the number of milli-seconds that the macro file is running or recording, or -1 if there is no active macro operation.
main { // If BUTTON_2 is pressed ... if(event_active(BUTTON_2)) { // ... run the macro "Example". macro_run("Example.gmk"); } // If the macro is running for over 2000 ms ... if(macro_time() > 2000) { // ... stop it immediately. macro_stop(); } }