Three answers were posted to the question (one of them was mine). Shortly afterwards, the OP posted a comment that indicated the perfectly valid question we were answering did not apply to the actual problem they were facing, since they were using AJAX.
It is important to note that this was not missing or additional context; the question was complete and self contained in its original form. In fact, the new information contradicted the original premise of the question (see detail).
Only one of the answers (posted after the comment) covered what was mentioned in the comment. The author of this answer edited the question to reflect the OP's comment.
On the one hand, this invalidates the other two answers, and entirely changes the question. On the other hand, it must be conceded that the new question is the one the OP meant to ask, so any new answers will solve the problem the OP is actually facing IRL.
In general, if it is discovered through comments that a valid, answerable question (again, this does not pertain to situations where necessary context is added through comments) is not applicable to the OP's real world problem, should the question be edited to reflect the OP's actual problem, or should the question be allowed to stand? Should there be a difference in approach when answers are already present vs. when there are no answers?
To clarify, the original question was about functions that take a certain duration of time to execute (3s in the example provided by the OP). Later, the OP mentioned that the callback does not, in fact, take 3s to execute, but that it contains an AJAX call that takes 3s to execute. Since the function in question now executes instantly, it invalidates the premise of the original question.