Arduino Mega2560 Interrupt library and examples

felix_fetche:
I medd to setup a timer that will call a function that will execute integration, need to use like measuring battery capacity, function will integrate measured value*dt

Why not simply use millis() or micros() to manage the timing as illustrated in Several things at a time.

And have a look at Using millis() for timing. A beginners guide if you need more explanation.

...R