Article View: borland.public.cppbuilder.nativeapi
Article #14953Re: Does TTimer interval including Processing Time?
From: Rodolfo Frino
Date: Wed, 23 Jul 2003 04:56
Date: Wed, 23 Jul 2003 04:56
67 lines
2901 bytes
2901 bytes
There are two parameters to take into account:
1) The Timer Routine Duration (TRD): this is the time taken to execute the
body of the
Timer Event Handler (Timer1Timer)
2) The Measured Timer Interval (MTI): Time difference between the start of
two
consecutive timer routines. (This is, in general, different to the
Timer Property Interval)
In general the TRD and the MTI are different, being
MTI >= TRD
For example if the timer interval is 50 mS:
Timer1->Interval = 50;
and the Timer Routine Duration is, on average 250 mS, then the timer will
not
trigger every 50 mS. It will only trigger at some point after the timer
routine has
finished. In General it will not trigger immediately after the Timer Routine
has finished
either. These are real numbers taken from a test program:
Timer Routine Duration = 240
Measured Timer Interval = 250
Timer Routine Duration = 261
Measured Timer Interval = 271
Timer Routine Duration = 240
Measured Timer Interval = 250
Timer Routine Duration = 250
Measured Timer Interval = 250
etc.
Rodolfo
then the
"Phuoc Can HUA" <home}a+t{huaonline.com> wrote in message
news:oprsqp0tqnbq7az6@newsgroups.borland.com...
> Q1: If the interval is 50ms and the routine needs 10ms will the routine be
> called every 60ms?
> If that's not the case, i.e. as long as the processing time less than the
> interval I can rely on the timer(?)
>
> Let's say I've got 2 routines for a timer event, one is 10ms and 2nd one
> 20-45ms, i.e. sometimes it will exceed the timer interval of 50ms. The 2nd
> routine is only called every 5th time of the 1st one.
> Q2: If I define a 2nd timer of 250ms for the 2nd routine will it increase
> the accuracy of the timers?
>
> thanks
> Phuoc Can HUA
>
> --
> _/\__/\__/\__/\__/\__/\_
> www.huaonline.com
> My Homepage is my Castle
Technical Details
Message-ID:
<3f1e1561@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<oprsqp0tqnbq7az6@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,354c421bf944414a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-22 22:09:24 PST From: "Rodolfo Frino" <rodolfofrino@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <oprsqp0tqnbq7az6@newsgroups.borland.com> Subject: Re: Does TTimer interval including Processing Time? Date: Wed, 23 Jul 2003 14:56:34 +1000 Lines: 69 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 203.206.23.168 Message-ID: <3f1e1561@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1058936161 203.206.23.168 (22 Jul 2003 21:56:01 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail