How to put the parametrs correct in the JSON request

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #16
    Why not just a run a separate timer whose function is to handle the KeepAlive call?

    Personally, I call KeepAlive every 60 minutes - that way I am well within the window to keep the session alive, and even if I missed a timer (for whatever reason), I should still get the next one 60 mins later.

    Comment

    • jabe
      Senior Member
      • Dec 2014
      • 705

      #17
      Originally posted by betdynamics View Post
      Why not just a run a separate timer whose function is to handle the KeepAlive call?

      Personally, I call KeepAlive every 60 minutes - that way I am well within the window to keep the session alive, and even if I missed a timer (for whatever reason), I should still get the next one 60 mins later.
      It's an option, though it makes me wonder whether the overhead of a second timer is greater than counting seconds and minutes. I had been wondering why the marketBook for some of the approaching games were not bing checked as often as I expected, and the Timer control inaccuracy apparently explains that too.

      Comment

      • betdynamics
        Junior Member
        • Sep 2010
        • 534

        #18
        I'm not sure what the overhead would be.

        Why don't you do a comparison?

        At the moment, your KeepAlive happens every 9-10 minutes. Put in a second timer and then see if the KeepAlive happens every 5 minutes.

        If you are hanging everything off a single timer, then won't the processing time of the timer function start to have a decremental effect?

        Comment

        • jabe
          Senior Member
          • Dec 2014
          • 705

          #19
          Originally posted by betdynamics View Post
          I'm not sure what the overhead would be.

          Why don't you do a comparison?

          At the moment, your KeepAlive happens every 9-10 minutes. Put in a second timer and then see if the KeepAlive happens every 5 minutes.

          If you are hanging everything off a single timer, then won't the processing time of the timer function start to have a decremental effect?
          I could indeed. I know if I set the Timer interval to, say, 300 seconds or 30000ms it would fire close to 300 seconds, give or take about 1/130 of a second. I could get my counter to increment the counter of seconds whenever the counter of ticks reaches 65.

          I did wonder about the effect of the processing that happens within the Tick subroutine, but I can't see why it would slow down the Timer. The Timer should essentially raise a Tick event when the interval is reached and then carry on with keeping time till the next interval is up. So I assume that the Tick processing doesn't slow down the Timer. But I will test it and get it to send a message whenever it is triggered and see how far apart those messages are. I'll let you know how that goes.

          I want the program to work in the way it was intended to work. The whole of the program is driven by the Timer, and if the Timer is wrong, all my later assumptions are off, not just the Keep Alive call.

          Depending how close an event is to its start time, the odds might be requested every 30 minutes, or 15, or 5 minutes, or every half a minute. Once it's completed, there are checks at other intervals to find out which the winning runner was on certain of its markets. I'm not going to add a timer for each time interval. I've got screen refreshes happening once a second if the screen items were updated. I've got other queued items dependent on the timer.

          It is likely that at some point I will want to use the WINMM.DLL functions to process MIDI data in a future project, so I might as well try to use it.

          I might try counting 65ths of a second to see how those vary, though just getting the time whenever the Tick event occurs should suffice.

          Comment

          • betdynamics
            Junior Member
            • Sep 2010
            • 534

            #20
            It turns out that there quite a few different types of Timer in .Net.

            This article may be worth a read:

            https://web.archive.org/web/20150329.../cc164015.aspx

            Comment

            • jabe
              Senior Member
              • Dec 2014
              • 705

              #21
              Thanks, I'll check that out.

              Comment

              • jabe
                Senior Member
                • Dec 2014
                • 705

                #22
                I set my program running with it assuming 65 Timer1 ticks to the second. That makes 19500 between Keep Alive calls. At first it was a bit variable, but when I went out it settled down. There were 26 intervals and the last 19 varied from 5m06s to 5m10.

                Intervals:

                7m02s, 5m12, 5m55, 5m55, 6m16, 7m03, 6m09,
                5m08, 5m06, 5m10, 5m06, 5m06,
                5m07, 5m06, 5m06, 5m06, 5m06,
                5m07, 5m06, 5m07, 5m06, 5m07,
                5m07, 5m07, 5m06, 5m08

                Perhaps the other things I was doing on the PC during the first seven intervals slowed the timer down.

                Comment

                Working...
                X