<div dir="ltr"><div>One line I know, maybe this is enough :</div><div><br></div><div>>>> from qgis.utils import plugin_times<br>>>> plugin_times</div><div><br></div><div>It's not using the profiler. Values are different from the Profiler, after a quick look...<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 5 mai 2023 à 10:21, Michel Stuyts via QGIS-Developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg1117206290136605844">





<div style="overflow-wrap: break-word;" lang="NL-BE">
<div class="m_1117206290136605844WordSection1">
<p class="MsoNormal"><span lang="EN-US">I want to use the data on plugins from the Profiler.  In the “Debugging/Development Tools” Panel I can see both the total time for all plugins and the individual time per plugin.  With the following Python code, I want
 to get the same data in Python:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"" lang="EN-US">profiler = QgsApplication.profiler()<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"" lang="EN-US">for child in profiler.childGroups():<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"" lang="EN-US">    childGroup = profiler.childGroups(child)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"" lang="EN-US">    if child == 'Load plugins':<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"" lang="EN-US">        print(child, profiler.profileTime(child))<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"" lang="EN-US">        for subGroup in childGroup:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"" lang="EN-US">            print(subGroup, profiler.profileTime(subGroup))<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">It shows the total time for all plugins just fine as “Load plugins” with the same number of seconds as in the Panel, but for the individual plugins I get 0.0 as time for all plugins.  What do I do wrong or is it a bug?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Michel Stuyts<u></u><u></u></span></p>
</div>
</div>

_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</div></blockquote></div>