micros() max value before overflow

Hello, i need to know the micros() biggest value before overflow, so I can implement an "asincronous" pulseIn(), and also "pulseOut()".
I don't much precision for the length of pulse, +-100microsec is enough, but it has to be fast.

http://arduino.cc/en/Reference/Micros

Unsigned long variables are extended size variables for number storage, and store 32 bits (4 bytes). Unlike standard longs unsigned longs won't store negative numbers, making their range from 0 to 4,294,967,295 (2^32 - 1).

From http://arduino.cc/en/Reference/UnsignedLong

Are you sure micros() will use all unsigned long values?
btw thank you ;D

Use the Source, Luke.

volatile [glow]unsigned long[/glow] timer0_overflow_count ;
...
[glow]unsigned long[/glow] micros() {
...
m = timer0_overflow_count;
...
}

That should remove all doubt.

Korman

Are you sure micros() will use all unsigned long values?

The value returned by micros is always evenly divisible by four. (At least that's what I remember)

The value returned by micros is always evenly divisible by four.

... on Arduino with a 16MHz CPU. On 8MHz CPU it will be evenly divisible by 8.

Korman