Creating a function

vceklic:
Example that you show does that but, when time passed I need to reset timer so that when I do some other operations I would call the function with same or different waitTime variable as previous time, so

batPrevMillis[batteryNumber] += waitTime;

does not do the trick.

Problem is that it is not always the same starting point. Any ideas?

I don't understand and I am not sure what "example" you refer to. Please post the latest version of the code that is causing the problem.

The code quoted above assumes that the wait period is the same for each battery. But it should keep the times for each battery separate - in your Array.

If that is not what you want please explain clearly what is required.

It may be that your assumption that a "generic timer" is needed is not correct. Please explain what your project is trying to do.

...R