TimeSpan.FromMilliseconds(1) and TimeSpan.FromTicks(1)

Created at 19 May 2018, 13:48
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!
TH

thongbaogiaodich

Joined 19.05.2018

TimeSpan.FromMilliseconds(1) and TimeSpan.FromTicks(1)
19 May 2018, 13:48


Dear cTrader,

I'm programing a robot for news trading. My main code put inside OnTimer() and in OnStart() I put Timer.Start()

Will have difference result if I use

Timer.Start(TimeSpan.FromMilliseconds(1));

or use

Timer.Start(TimeSpan.FromTicks(1));

My Server Latency is 45ms

Thanks!


@thongbaogiaodich
Replies

PanagiotisCharalampous
21 May 2018, 09:16

Dear thongbaogiaodich,

A millisecond contains 10000 ticks. Therefore, you will have a difference. Read more here.

Best Regards,

Panagiotis


@PanagiotisCharalampous

thongbaogiaodich
21 May 2018, 10:26

Thanks for your reply!

But if my Server Latency is 45ms, will have difference between them or not? Because as I understand, my Server will update new data each 45ms.


@thongbaogiaodich

PanagiotisCharalampous
21 May 2018, 11:53

Hi thongbaogiaodich, 

This is not what latency means. Latency means that data will arrive from the server to your pc after 45ms. The rate of update is not affected. 

Best Regards,

Panagiotis


@PanagiotisCharalampous