Posts made by Tim Hunt

Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You can get an initial indication of where the time is being spent using the Developer tools in your web browser. The Network tab will show you what is loading, and how long each thing takes. (However, my guess would be that it is processattempt.php.)

Turning on Moodle's option to display performance info in the page footer (https://docs.moodle.org/311/en/Debugging#Performance_info) can also give some clues.

To drill down into even more detail, you really need a PHP profiling tool (e.g. Tideways - https://docs.moodle.org/dev/Profiling_PHP).
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Don't be afraid to try this out (e.g. at https://qa.moodledemo.net if you don't have a test Moodle of your own that you can use). In this case, experimenting yourself would probably have been quicker than waiting for someone else to answer.

I'm pretty sure that it works the way you want.