I don't understand why in this case there's a freeze for a few seconds:
I expected that enabling the "asynchronous" option would allow the function to run in parallel with the main thread. Similar to how the "Find path" action works with the "Pathfinding" behavior. That is, the action starts the pathfinding process in parallel with the main thread, which avoids performance loss.
What should I do if I need to create a heavy function that can run for several seconds and I don't want to get the game process frozen for that time while the function is running?