I need to document the startup/shutdown time of my self-hosted WebAPI server. This is required as there are lot of configuration file readings going on during startup. I couldn't find any way to measure this as the it somewhere happens inside this usually:
CreateHostBuilder(args).Build().Run();
Can I add any profilers, performance log within the app so as to get the required performance data? Or else, is there any other way to do it?