I would like to periodically call a function (assume it's name is "alter(id)") with the parameter changing every call. The parameter should increment with every call and return to 0 at some point. On a timeline it would look like this:
Time: function to call
0ms: alter(0)
300ms: alter(1)
600ms: alter(2)
900ms: alter(3)
1200ms: alter(0)
1500ms: alter(1)
and so on ad infinitum.