powermetrics command could help you here.
man powermetrics
powermetrics command could help you here.
So this looks like it will help with tasks/processes that are running after logging in.
But I'm talking about earlier than that - the bit where the Apple logo progress bar is in progress, as the machine is starting up.
On Windows I can use Process Monitor to set up a setting that will perform analytics etc on the next boot to help identify potentially problematic processes that are holding things up, I was just wondering if anything similar exists for macOS.
Basically, we have some users who have reported that Macs in their classrooms are taking a long time to start up (and we've seen this ourselves) and so we'd like some way to be able to identify the cause of the issue. Wiping and reinstalling the computer does not always fix the issue, but Apple Diagnostics does not report any hardware faults.
Using launchdaemon will allow you to run a script that executes powermetrics before the user logs in.