We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following example will time imports
import imp import sys import timeit class Loader(object): def __init__(self, path): self.path = path def load_module(self, name): if name in sys.modules: return sys.modules[name] before = timeit.default_timer() try: module_info = imp.find_module(name, self.path) module = imp.load_module(name, *module_info) finally: after = timeit.default_timer() print('{: <50s} {:.5f}s'.format(name, after - before)) sys.modules[name] = module return module class Finder(object): def find_module(self, name, path=None): return Loader(path) sys.meta_path.insert(0, Finder())
It would be nice to have it as a pikos monitor
The text was updated successfully, but these errors were encountered:
code provided by @sjagoe
Sorry, something went wrong.
No branches or pull requests
The following example will time imports
It would be nice to have it as a pikos monitor
The text was updated successfully, but these errors were encountered: