Problem is not clear for the above code. Please try to change your timer frequency value and post the results if you observe any change in the output.
However, to get a fast working timer task code, Try to define the timer variable inside the TimerTask class definition and use schedule API on it. Example:
timer.schedule(this, 2500, 2500).