Jump to content

10 minute timer


Recommended Posts

Posted
public void onStart(){
startTime = System.currentTimeMillis();
endTime = startTime + 600000;
}

public int onLoop(){
  if(endScript(){
     stop(true);
     }
}

private boolean endScript(){
  return System.currentTimeMillis() >= endTime;
}

get your startTime and endTime on the onstart, have a boolean for if currentTime is after endTime and then run a check in your onLoop for it that boolean is true

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...