As far as I know there is no way you can do this simply...
Because if I understand correctly you want it to eat every lets just say 20 seconds, but you still want the script to run normally....
However, you can try this, not guaranteed it will work but still:
private final int timeToWait = 10; //In seconds;private int startTime;private int runTime; @Overridepublic void onStart(){ startTime = System.currentTimeMillis(); //Set the start time for first time..} @Overridepublic void onPaint(Graphics g){ updateInfo(); //Update the runTime every second, There might be a better way but idk what it is.} @Overridepublic int onLoop(){ if(runTime > timeToWait){ //Checks if the run time passed the wait time eatFood(); //Some method... You will have to make this I wont spoon feed you. startTime = System.currentTimeMillis(); //Resets the startTime. }} private void updateInfo(){ runTime = (System.currentTimeMillis() - startTime) / 1000; //Basicaly takes the current time and subtracts from time started then finds it in seconds.}