HELP ME WITH cycle WHILE. IT don`t work in cAlgo
HELP ME WITH cycle WHILE. IT don`t work in cAlgo
15 Jul 2014, 14:43
void process()
{
while (true)
{
try
{
Print("Test");
} catch (System.Exception e)
{
Print(e.Message);
}
Thread.Sleep(20);
}
}
protected override void OnStart()
{
ThreadStart ts = delegate { process(); };
Thread th = new Thread(ts);
th.Start();
}
When I run this code. CTrader not cope, RAM is overloaded, growing and CTrader freezes. Help solve the problem.
I need cycle with 20 miliseconds interval. I can`t use timer, becouse now it only in seconds.
Invalid
16 Jul 2014, 09:27
RE:
Probably memory is growing because you add message to log every 20ms.
I've answered you about timer in another thread.
mistica87 said:
@Invalid