Can a long OnTick() be interrupted by fast OnTimer() ??? (MT5)

 

Hi,

Let's suppose that I have an :

1) OnTick()  function that takes 400 milliseconds to execute.
2) OnTimer() function that takes  10 milliseconds to execute.

If I have EventSetMillisecondTimer(100), what will happen? :

1) Will OnTick() function be interrupted several times during its execution to run OnTimer() and then resume its execution (every time it is interrupted)?
2) Will OnTimer() events be ignored until OnTick() function is fully executed ?

Thanks !

 
ccou: Let's suppose that I have an :


1) OnTick()  function that takes 400 milliseconds to execute.
2) OnTimer() function that takes  10 milliseconds to execute.

If I have EventSetMillisecondTimer(100), what will happen? :

1) Will OnTick() function be interrupted several times during its execution to run OnTimer() and then resume its execution (every time it is interrupted)?
2) Will OnTimer() events be ignored until OnTick() function is fully executed ?

The OnTick() event handler will not be interrupted. It will hold control until it returns. All pending events (of any type), will be queued (not ignored) and will await their turn to be processed.

The same applies to the OnTimer() event handler (or any other event handler) — it will hold control until it returns, and then the next queued event will be processed.

 
Thanks very much Fernando !
 
ccou #: Thanks very much Fernando !

You are welcome!

Reason: