Your computer has to be running on battery to do so. Navigate to "Settings -> System -> Power & Battery" on Windows 11. Under the "Battery usage per app" section, you'll see a list of apps that have been consuming battery. Check the "In use" value underneath each app to learn how much time you spent on it. On Windows 10, check "Settings -> System -> Battery," then click "See which apps are affecting your battery."