This will almost certainly be false, because doubles are stored as binary fractions and cannot represent every real number. This means there is no exit from the infinite for loop - hence the time limit problem.
To fix this, you need an arbitrary precision value such as :
double MyPrecision = 0.001;
if amount is less than MyPrecision then that is the end condition. Your break only breaks from the for loop that it is in, so you need a better way. Try a while loop instead.