For a timer you could do something like this:
//Class variable
private long timer;
//when you want to start/reset the timer
timer = System.currentTimeMillis();
//to check if the timer is past a certain amount of time, ex. 1 min.
System.currentTimeMillis() - timer >= 60000;