public static void waitForOrKill(Process self,long numberOfMillis){
  ProcessRunner runnable=new ProcessRunner(self);
  Thread thread=new Thread(runnable);
  thread.start();
  runnable.waitForOrKill(numberOfMillis);
}

public static void waitForOrKill ( Process self , long numberOfMillis ) { ProcessRunner runnable = new ProcessRunner ( self ) ; Thread thread = new Thread ( runnable ) ; thread . start ( ) ; runnable . waitForOrKill ( numberOfMillis ) ; }
wait for the process to finish during a certain amount of time , otherwise stops the process .
