in debug mode report the time to load addon modules.

This commit is contained in:
Campbell Barton 2010-07-26 09:09:53 +00:00
parent ed5d0bb62f
commit 15e94823dd
2 changed files with 10 additions and 1 deletions

@ -210,7 +210,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
print("gc.collect() -> %d" % gc.collect())
if _bpy.app.debug:
print("Time %.4f" % (time.time() - t_main))
print("Python Script Load Time %.4f" % (time.time() - t_main))
def expandpath(path):

@ -829,14 +829,23 @@ class USERPREF_PT_addons(bpy.types.Panel):
@staticmethod
def _addon_list():
import sys
import time
modules = []
loaded_modules = set()
paths = bpy.utils.script_paths("addons")
if bpy.app.debug:
t_main = time.time()
# sys.path.insert(0, None)
for path in paths:
# sys.path[0] = path
modules.extend(bpy.utils.modules_from_path(path, loaded_modules))
if bpy.app.debug:
print("Addon Script Load Time %.4f" % (time.time() - t_main))
# del sys.path[0]
return modules