Calculate the ampere hour rating of a battery using current over time and voltage over time
Just integrate the current as a function of time, and express the result in ampere-hours. If the current is constant you can just multiply the current by the length of time, in hours, that the battery supplied this current.