Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Time and Animation [4/9]

This program calculates and displays the time elapsed between last two animation frames.

An animation frame is one complete image drawn to the computer screen.

This program draws one animation frame on each iteration of the while loop.

The elapsed time varies on different computers and display devices. It is usually in the range of 8–50 milliseconds (0.008 – 0.050 seconds), corresponding to the frame rates of 20-125 Hz.

After running and studying the program, add a new variable i at the beginning of the source code. Make this variable increase by one in each iteration of the while loop. Also, in the while loop, add another println statement that displays the value of variable i.

Loading...