Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Java slick2d , i started printing out Delta which is supposed to be the time and it prints out is 16 or 17 forever, so how does this help me if i want to tell an object when it needs to do something, example : IF (createdtime + 60miliseconds < delta )

60miliseconds after its creation , do something

share|improve this question
up vote 3 down vote accepted

Delta time is the amount of time since the last update. You're getting 16 or 17 because it has been 16 or 17 milliseconds since the last update. If you want to know how long your game has been running, do something like:

long runningTime = 0; //declared outside the update loop

//in update loop put:

runningTime += deltaTime;

if(runningTime > 60)
    //do something every frame after 60 milliseconds.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.