Hi..

I've worked a good deal with time & timers..

I think that perhaps we've addressed this a time or two.

There are a few catches I'll warn you about tho'.

The system tick cannot be reliably depended upon.
I have a clock that uses 100ths of a minute as
opposed to seconds.  The math is simple
divide the seconds by 60.  The catch is
this won't work for actual 100ths because
I needed parts of a second.
 ( ie  .01 hundredths is .6 seconds )

So I use the system tick instead.  Since
there are "assumed" 100 systicks per
second that makes 6000 per minute.

Sounds granular enough..  and it works
to a degree.  As functions process some
ticks get stolen from the count.  So I
adjust my count of the ticks at every
0 second.    That seems to have
covered the "drift" factor.

I was loosing about a 100th for every
minute of real time.  With the adjustment
it keeps good time compared to the
TimeSync clock (a true 100th clock)

But at MIDNIGHT it chokes.  Guess
the device does some housekeeping
at this time and hoses my counter.
Just letting you know about that one.

Now for a few more relevant comments.
You can fire an event at a "regular"
interval in the event loop like so..

EvtGetEvent(&event, sysTicksPerSecond/6);
// Loop until 1/6 second passes for TIME

so perhaps you could reduce this down to
a 100th of a second...   but not much further.

So the next direction I see is some sort of
interrupt driver that keys on the cpu clock
itself.  Generate an interrupt by the tick
of the cpu clock.  and handle it somehow.

Need to be some system level hack that
would fire an event for you to process.

Really ,  really wish I could help you...

HowY



> > Is there a function I can patch on to that I can be sure gets called at
> > regular intervals. I must be REALLY sure!
> > I'd prefer a function that gets called every 10ms or so. Something like
a
> > tick increase function. Is there such a function? Any other way to
create
> > callback without occupying the OS/executing program?
> > And please don't tell me to wait in my event loop, that would definitely
> > halt other programs!






-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to