I use System.nanoTime() to compute the exact duration of the most recent frame. I then compute a time factor from frame duration, which is applied in all computations. This way, you get approximately performance-independent game behavior. Pseudocode example:
// Initialize timer
timer=nanotime
// Game loop
while game running
// Update timer
timer=nanotime-timer
// Compute delta (this is a float or double!)
delta=nanotimer/10e6
// Example application: Movement
exampleposition+=examplevelocity*delta
Note: You have to be a bit careful when dealing with derivates (e.g. accelleration), know your calculus
hth Wolfgang
“I’m a ****ing starship, I’m allowed to cheat!”
GCU Arbitrary, Culture Craft