[U-Boot] [RFC][Timer API] Revised Specification - Implementation details

Wolfgang Denk
2011-05-27T11:26:10Z

Dear Graeme Russ,

In message <BANLkTimB4YKkpk10gZkoRmLUYqbPxTHUKQ@mail.gmail.com> you wrote:
>
> > Nobody claims that get_timer() has any specific resolution. It is
> > perfectly legal that a loop like
> >
> > for (;;) {
> > u32t = get_time();
> >
> > printf("t=%ul\n", t);
> > }
> >
> > returns 100 millisecond increments.
>
> Except everyone expects it to tick at something vaguely close to 1ms.
> When you comment about accuracy, I didn't expect 1000% error was
> acceptable...

This is not an error. It is resolution, which is a completely
different thing.

Under Linux, gettimeofday() also returns time information in seconds
and microseconds, yet the same loop as above will print the time in 10
ms jumps when you set HZ=100.

This is normal behaviour for this type of functions.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Extended Epstein-Heisenberg Principle: In an R & D orbit, only 2 of
the existing 3 parameters can be defined simultaneously. The parame-
ters are: task, time and resources ($).