View Single Post
11/13/18, 09:35 AM   #1
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
[outdated] defer function

Quite often I find myself wanting to run code right after the current function ended, but without unnecessary delay. Usually I would use zo_callLater(myFunc, 0) to do this, but this would wait for the next frame to begin. For example when I put a function into a queue and it can actually be executed right away, but the code that places it in the queue has to finish first.

For this reason I'd like to see a new function "defer(myFunc)" which calls the passed function immediately after the current callstack is over with zero delay.

Here's a picture that should clarify what I mean: