time measure

Hej,

I guess that Dave Mellis will fill in with more details in a while but the way we count time in microseconds is a tricky one (it is an assembler loop that assures accuracy to do things like DMX, serial, etc).

At this point I dont really know how much we can touch the libraries to do exactly what you want, but you can always use the trick of counting how long it takes to make an operation e.g. 1000 times, and use that as a trick to count.

The issues regarding time resolution have to do with:

a) the clock is working at "only" 16MHz (much faster than many commercial stamps), so that we count in tens of nanoseconds

b) the open source compiler is not 100% reliable when transforming code: e.g. 1 addition written in C takes more than 1 clock-cycle even if the processor has RISC architecture

Dave will probably add on this later.

/David