is this the best/fastest /most accurate way ?

to find an an uknown resistor value with avr?

single range i.e 0 to 50kohm needed

atc i am claclulating voltage drop oner a known resistor and do all the math, but it seems too much calculation's takes place.

and not very accurate at all, when resistors increased in value