Servo Motor timed reaction

PaulS:
Hitting EXACTLY 1000 may be a problem.

i change the if condition to if(condition1 > 800 && condition < 1500)
the servo changed position accordingly from 100, and for a moment before changing to 0.