Recent

Author Topic: [SOLVED] Timer  (Read 2045 times)

alpine

  • Hero Member
  • *****
  • Posts: 1038
Re: Timer
« Reply #15 on: March 24, 2023, 09:03:52 am »
Great, both solutions work. Thank you :)
Have a nice day
If the accuracy is important, I wouldn't count on a solution which decrements the seconds by itself rather than calculating a delta from the saved timestamp at the beginning. TTimer works with WM_TIMER messages and the docs says they can be coalesced when not processed quickly enough. Also any delay in processing may sum up into a cumulative error.
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2008
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Timer
« Reply #16 on: March 24, 2023, 04:47:40 pm »
Great, both solutions work. Thank you :)
Have a nice day
If the accuracy is important, I wouldn't count on a solution which decrements the seconds by itself rather than calculating a delta from the saved timestamp at the beginning. TTimer works with WM_TIMER messages and the docs says they can be coalesced when not processed quickly enough. Also any delay in processing may sum up into a cumulative error.
If you mean my example, I decrement in one timer each second a value to display but other timer (the real) is not harmed by it ...
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

 

TinyPortal © 2005-2018