Recent

Author Topic: TTimer Interval problem  (Read 4706 times)

Gerbert

  • New Member
  • *
  • Posts: 11
TTimer Interval problem
« on: May 08, 2012, 10:46:12 am »
Hello,

I use a TTimer component to do something every 5 min.
I have set the Interval to 300000.
The start event is fired when I enabled the timer.
After 5 minutes the timer event is fired.
Then after about each 1 minute the timer event is fired.
This is not correct because the interval is set on 300000.
I am using the Lazarus SVN deployment version (latest version) on Linux.
I am using FPC 2.6.0

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: TTimer Interval problem
« Reply #1 on: May 08, 2012, 11:46:22 am »
Components like timers are highly operating system (and even widgetset) dependent. What are your testing conditions?

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: TTimer Interval problem
« Reply #2 on: May 08, 2012, 12:55:34 pm »
At least there is alternatives in this thread:
http://lazarus.freepascal.org/index.php/topic,16530.0.html

Using interval 1000 and using system time to see when 5 minutes have passed.

Gerbert

  • New Member
  • *
  • Posts: 11
Re: TTimer Interval problem
« Reply #3 on: May 08, 2012, 02:08:12 pm »
@marcov
I am testing on Android 2.3.7 on a HTC Desire GSM.

@User137
I will try the given example. Thanks.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: TTimer Interval problem
« Reply #4 on: May 11, 2012, 10:01:46 am »
The timer is native from Android. You can always inspect the code to see if you find if I am doing something wrong, it is the java file in src/com/pascal/lcltest/ But it is probably just how the native timer works.

 

TinyPortal © 2005-2018