Test 3

The coordinates of the rectangles are incremented using a timer once every 10 ms, but the actual update of the visual elements is sheduled with a requestAnimationFrame once every 2 increments only. This trick of skipping some updates is usefull for example to keep the CPU free for other tasks or to group more updates comming from multiple timers or external events.

Rectangles in cloud: