Magento2 – Code profiler from .htaccess file.
1. To enable the code profiler from .htacess
2. Open pub\static\.htaccess or root\.htaccess file. (Depend on the mode what we enabled from magento)
3. I have run magento website with developmer mode. I have enabled profiler from root\.htaccess.
4. Add following code from .htaccess file top of the line.
Ex for CSV format:
“SetEnv MAGE_PROFILER csvfile” //Profiler report will generate as a CSV file from root/var/log/profiler.csv
Refer below sample screen shot.
Ex for html format:
If you add below line of code, then profiler will generate the report next to footer section with HTML format.
SetEnv MAGE_PROFILER html
Refer below sample screen shot.
Leftside section is called Timer ID & right side section you will find the time approx how it was taken for the executing the code.