If this is called in a trigger action context, ExecuteFunc will use that trigger, so GetTriggeringTrigger will return it. If ExecuteFunc is
called in another type of context, it will spawn a new trigger, which can be seen with GetTriggeringTrigger.
ExecuteFunc does not seem to release the trigger it spawns.
As ExecuteFunc will run the target function in a trigger action context one way or another, TriggerSleepAction can be used.
Performance numbers:
Result: plain Lua is ~43.5x and ~724x faster respectively.
Source: Unryze's test results using this code and his UjAPI (Jass on 1.26a; Lua on 1.32.10 and 1.26a).
Generated using TypeDoc
Tries to find a function with the given name and calls it in a new thread.