[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Timing in FBUS_Initialise()

From: Timothy Murphy
Subject: Timing in FBUS_Initialise()
Date: Fri, 31 May 2002 23:45:10 +0100
User-agent: Mutt/1.2.5i

On Fri, May 31, 2002 at 09:06:34PM +0200, Pavel Machek wrote:
> > ==============================================
> > struct timeval t0,t1,t2;
> > ...
> > gettimeofday(&t0,NULL);
> >     // for (count = 0; count < glink->InitLength; count++) {
> >     for (count = 0; count < 10; count++) {
> >             // usleep(100);
> >             usleep(20000L);
> >             device_write(&init_char, 1);
> >     }
> usleep sleeps 10msec minimum. do busy-loop with gettimeofday.

Exactly -- that is just what I found (and said).

My point was (in part) that there is a note in the gnokii code
to say that the timing (using usleep(100)) is "empirical",
which I took to mean the result of experiment.

However, this is rather misleading if my computer is typical,
as it would make no difference if the 100 were replaced
by any number from 1 to 10000.

Also the number of repetitions, 250, 
is equally arbitrary,
as any number from 10 to 1000 seems to do equally well.

I'm not complaining -- 
I was genuiunely asking if the timing made more sense
on other machines,
and equally if the number of repetitions
mattered with other phones.

My query arose because I re-wrote part of gnokii in Java,
but have yet to get any response from my phone.
I thought this was due to the fact that I could not reduce
the timing to 100 microseconds --
but now realise the cause must be sought elsewhere.

Incidentally, I am a great admirer of gnokii,
and am very grateful (as I said) to the authors.

The criticism from the author of mygnokii,
that the gnokii team take no notice of bug-reports and similar comments,
seems completely misplaced to me.
In fact I don't know any software project
where the response is (in most cases) so fast.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]