Cannot set milisecond timer?
Hi Everyone!
I hope you are fine. I have a problem -just sometimes-. I am creating a timer handler like this...
And works fine. But some users experience this error: Cannot set milisecond timer(50) and the program fails.
Am I doing something wrong?
Thanks in advance
#property copyright "author name"
#property link "localhost"
#property version "1.00"
#property strict
int OnInit(){
EventSetMillisecondTimer(50);
return(INIT_SUCCEEDED);
}
void OnDeinit(const int reason){
EventKillTimer();
}
void OnTick(){
//code executes here when there is a tick
}
void OnTimer(){
//code here executes every 100ms or as available.
}
Is there a minimum time allowed? I remember reading somewhere about a minimum of 100...it may be for the sleep function, can't remember off hand.
No, you can use EventSetMillisecondTimer(1) if you so wish.
Which builds is this happening with?
Use it:
https://www.mql5.com/ru/forum/167394
- www.mql5.com

Hi Everyone!
I hope you are fine. I have a problem -just sometimes-. I am creating a timer handler like this...
And works fine. But some users experience this error: Cannot set milisecond timer(50) and the program fails.
Am I doing something wrong?
Thanks in advance