Add a frame counter

In every loop it's increased by 1.