You have three functions:
1. Get global time
2. Stop timer(after stop it store it in variable)
3. Restart timer
You should write a function that get actionFunction.
The function will return after 50ms.
B. The function gets a lot of functions(some of them take more than 50ms) and you should return from the function the closest ms to number of functions multiple 50ms
Note: You gets the function one by one and don’t know how much in the overall