Apple just released iOS 11.3, and among other things, the updated includes a new tool to tell you whether or not your aging iPhone battery needs to be replaced.
This is Apple's response to their slowing the iPhone operation to save battery life. Well, this new utility will examine the life expectancy of the battery and whether its time to get the battery replaced.
Install iOS 11.3 in Settings > General > Software Update on your iPhone. The battery life measurement will examine whether the battery performance is still at peak performance or throttled capacity due to age and reduced capacity. The user can temporarily turn off the performance management in favor of faster operation.
Apple is replacing all out-of-warranty batteries that have lost capacity (iPhone SE through iPhone X) until Dec. 31, 2018 for $29.