public synchronized void schedulePeriodicTask(TimerTask task,long period){
  try {
    m_timer.scheduleAtFixedRate(task,0,period);
  }
 catch (  IllegalStateException ie) {
    m_timer=new Timer();
    m_timer.scheduleAtFixedRate(task,0,period);
  }
}

public synchronized void schedulePeriodicTask ( TimerTask task , long period ) { try { m_timer . scheduleAtFixedRate ( task , 0 , period ) ; } catch ( IllegalStateException ie ) { m_timer = new Timer ( ) ; m_timer . scheduleAtFixedRate ( task , 0 , period ) ; } }
schedule a task that starts immediately
