30.01.2019, 04:34
Hi, please help me understand pawn's order of operations by considering the following code:
So it's not that hard to understand that "F2" will be printed before "F1", but what about "F3"?
Will the order always be "F2 F1 F3", or maybe due to the low 1 tick value, the timer callback will RARELY be executed first, so that "F3" is printed before returning to the original function and printing "F1".
Additionally, what if instead of a single print("F1") I would do a lot more, will that delay it enough so that the timer is executed before the first function finishes?
In a nutshell, how reliable it is that the timer will always run last?
Код:
stock FirstFunction() { SecondFunction(); print("F1"); } stock SecondFunction() { print("F2"); SetTimer("ThirdFunction", 1, false); } stock ThirdFunction() { print("F3"); }
Will the order always be "F2 F1 F3", or maybe due to the low 1 tick value, the timer callback will RARELY be executed first, so that "F3" is printed before returning to the original function and printing "F1".
Additionally, what if instead of a single print("F1") I would do a lot more, will that delay it enough so that the timer is executed before the first function finishes?
In a nutshell, how reliable it is that the timer will always run last?