Stream API latency

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mthornal
    Junior Member
    • Jun 2012
    • 4

    #1

    Stream API latency

    Hi

    I'm just wondering what kind of latency to expect in the Stream API. I've subscribed to the market change subscription and when I read the stream I typically see a 1.3 second difference between the time in the pt field of the message and the time now according to my PCs clock. Is this what I should expect and what others see?

    Thanks
    Martin
  • LetsGo
    Senior Member
    • Oct 2018
    • 112

    #2
    I've been using Streaming for over a year and haven't had any problems with latency. I'm not sure what you mean with 'pt field'?

    Comment

    • mthornal
      Junior Member
      • Jun 2012
      • 4

      #3
      The "pt field" is the publish time sent with every change message. It's the number of milliseconds since 1970-01-01T00:00:00. When I compare the value in a change message with the current number of milliseconds since that date the difference is usually (although it does vary) around 1300 i.e. 1.3 seconds. Just wondering what others normally see in case it's a problem in my code/language/home network/broadband etc.

      Comment

      • LetsGo
        Senior Member
        • Oct 2018
        • 112

        #4
        Running some tests in the Visual Studio c# debug mode on my local PC, I found a delay of about 2 seconds, I run my live programs on an Azure service.
        I'll try some tests on the live server later in the week, I would like to know what the latency is with streaming, thanks for pointing this out.

        Here are my results:-
        Hour Min Sec Mill Delay
        Test 1 01:59
        pt 16 11 2 386
        DateTime.UtcNow 16 11 3 327
        Test 2 01:46
        pt 16 13 47 145
        DateTime.UtcNow 16 13 48 99
        Test 3 01:54
        pt 16 16 56 210
        DateTime.UtcNow 16 16 57 156
        Test 4 01:54
        pt 16 20 0 654
        DateTime.UtcNow 16 20 1 600
        Last edited by LetsGo; 23-01-2019, 05:42 PM.

        Comment

        • LiamP
          Junior Member
          • Oct 2015
          • 284

          #5
          Your clock is wrong or the data is being conflated, is the conflate flag true?

          Comment

          • LetsGo
            Senior Member
            • Oct 2018
            • 112

            #6
            Originally posted by LiamP View Post
            Your clock is wrong or the data is being conflated, is the conflate flag true?
            You may be correct, just checked my local pc time against the https://time.is/GMT site and I'm a second slow.
            I'll try the test again tomorrow when the racing is back on.

            Comment

            • mthornal
              Junior Member
              • Jun 2012
              • 4

              #7
              Originally posted by LiamP View Post
              Your clock is wrong or the data is being conflated, is the conflate flag true?
              Yep, the computer clock hadn't been updated and had drifted out. Just forced a synchronization and it's now showing a latency of around 40ms. Thanks!

              Comment

              Working...
              X