How to improve the speed of calculation

Created at 04 Nov 2017, 23:20
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
34

344260146

Joined 04.11.2017

How to improve the speed of calculation
04 Nov 2017, 23:20


protected override void OnStart()
{
    Timer.Start(1);//start timer with 1 second interval
}
protected override void OnTimer()
{
    ChartObjects.DrawText("time", Time.ToString("HH:mm:ss"), StaticPosition.TopLeft);
}

 

 

 

It can only be executed in one second??

 

 

 


@344260146
Replies

PanagiotisCharalampous
06 Nov 2017, 09:33

Dear Trader,

Thanks for your post. Unfortunately it is not clear what you are asking for. Are you trying to start the Timer with shorter intervals? If yes, then you can use the Start method overload that takes as input a TimeSpan instead of seconds. See below an example how to set the TimeSpan to 500 milliseconds.

 Timer.Start(new TimeSpan(0, 0, 0, 0, 500));

Best Regards,

Panagiotis


@PanagiotisCharalampous

344260146
11 Nov 2017, 15:49

RE:

Panagiotis Charalampous said:

Dear Trader,

Thanks for your post. Unfortunately it is not clear what you are asking for. Are you trying to start the Timer with shorter intervals? If yes, then you can use the Start method overload that takes as input a TimeSpan instead of seconds. See below an example how to set the TimeSpan to 500 milliseconds.

 Timer.Start(new TimeSpan(0, 0, 0, 0, 500));

Best Regards,

Panagiotis

Wow, thank you! Panagiotis! I've read your article, you're too bad, and this answer is what I need. I'm sorry that I can't make myself clear, because it's all through translation.
Now I have a new problem, and I need to read every value in the CSV file, but I can't find the code.
The code File.ReadAllText (Filepath) will read all the data at once, not what I need. I need to read them one by one.


@344260146