The iPhone's new update to iOS 12 includes a new feature in the settings - Screen Time. This is a very easy and useful way to track how much time you are spending on your phone. There are lots of other new features such as App Limits which lets you set time limits for individual apps or whole categories of apps.
Give it a try, and follow this easy guide to set it up.
https://www.wired.com/story/how-to-use-screen-time-ios-12/