{ "info": { "author": "Lukas Waymann", "author_email": "meribold@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "This module provides a context manager for measuring execution times:\n\n```python\n>>> from timethis import timethis\n>>> with timethis('computing large sum'):\n... x = sum(range(10**7))\n...\ncomputing large sum: 0.203 seconds\n```\n\nUsage of `timethis` can be nested:\n\n```python\n>>> with timethis('figuring things out'):\n... with timethis('computing large sum'):\n... x = sum(range(10**7))\n... with timethis('finding some primes'):\n... y = [2] + [i for i in range(3, 10**4) if all(i % j != 0 for j in range(2, i // 2 + 1))]\n...\n\u2502 computing large sum: 0.205 seconds\n\u2502 finding some primes: 0.305 seconds\nfiguring things out: 0.510 seconds\n```\n\nIt's easy to use (for example) `logging` instead of `print`:\n\n```python\n>>> import logging\n>>> with timethis('computing large sum', logging.warning):\n... x = sum(range(10**7))\n...\nWARNING:root:computing large sum: 0.218 seconds\n```\n\n[1]: https://docs.python.org/3/glossary.html#term-context-manager\n[2]: https://docs.python.org/3/reference/compound_stmts.html#with\n[3]: https://docs.python.org/3/reference/datamodel.html#context-managers\n[4]: https://docs.python.org/3/library/timeit.html\n[5]: https://github.com/dabeaz/python-cookbook/blob/master/src/14/profiling_and_timing_your_program/timethis.py\n[6]: https://github.com/jasonamyers/python-class/blob/master/timethis.py\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/meribold/timethis", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "timethis", "package_url": "https://pypi.org/project/timethis/", "platform": "", "project_url": "https://pypi.org/project/timethis/", "project_urls": { "Homepage": "https://github.com/meribold/timethis" }, "release_url": "https://pypi.org/project/timethis/0.1.1/", "requires_dist": null, "requires_python": "~=3.6", "summary": "Context manager for measuring execution times", "version": "0.1.1" }, "last_serial": 4419228, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "bc56a0854c498b23f51096743adfe459", "sha256": "11ccb856e8ea0130dc90dd39fe12d27ec8179f0868eed4a1b6c1f4fa4807aec8" }, "downloads": -1, "filename": "timethis-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "bc56a0854c498b23f51096743adfe459", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 2039, "upload_time": "2018-10-26T11:37:14", "url": "https://files.pythonhosted.org/packages/1d/42/579dc0938e52398d7098af01f56c7ffcc9f6215dd217ce5eb6ce68b332d3/timethis-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36041834b9c253bc16f84af4b7cd2f0a", "sha256": "392972c1d57056a0e262c73fd21eb58679e96e5f7ab7eddfcbd26ab223283f0f" }, "downloads": -1, "filename": "timethis-0.1.0.tar.gz", "has_sig": false, "md5_digest": "36041834b9c253bc16f84af4b7cd2f0a", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 1759, "upload_time": "2018-10-26T11:37:16", "url": "https://files.pythonhosted.org/packages/6e/be/b82e59da54fa6dfa95696f58c403d58cf8b0b478deed2f9891ade8dca36e/timethis-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8f6b59818d0397f54130e2c7cc90f728", "sha256": "0053827f2a90cfbef5a6df7da54a2702f1ac060135b58afdd8ebcbe672b3997d" }, "downloads": -1, "filename": "timethis-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8f6b59818d0397f54130e2c7cc90f728", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 2155, "upload_time": "2018-10-26T12:59:38", "url": "https://files.pythonhosted.org/packages/73/cf/7657df0fa90fd23f41e86fe70b73bedb08a6bd53d9a5895a212ff1aefb65/timethis-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a43087c0b43147f606e917e47349214", "sha256": "a5b8e379cac39f4aa014ba9ac4260509f80e6ad3e02b312f03c466464301d2bf" }, "downloads": -1, "filename": "timethis-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9a43087c0b43147f606e917e47349214", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 1905, "upload_time": "2018-10-26T12:59:40", "url": "https://files.pythonhosted.org/packages/14/b6/2d4540e740363746f4922584df9d7f342141e06814658cffd9eb7884d7b6/timethis-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8f6b59818d0397f54130e2c7cc90f728", "sha256": "0053827f2a90cfbef5a6df7da54a2702f1ac060135b58afdd8ebcbe672b3997d" }, "downloads": -1, "filename": "timethis-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8f6b59818d0397f54130e2c7cc90f728", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 2155, "upload_time": "2018-10-26T12:59:38", "url": "https://files.pythonhosted.org/packages/73/cf/7657df0fa90fd23f41e86fe70b73bedb08a6bd53d9a5895a212ff1aefb65/timethis-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a43087c0b43147f606e917e47349214", "sha256": "a5b8e379cac39f4aa014ba9ac4260509f80e6ad3e02b312f03c466464301d2bf" }, "downloads": -1, "filename": "timethis-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9a43087c0b43147f606e917e47349214", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 1905, "upload_time": "2018-10-26T12:59:40", "url": "https://files.pythonhosted.org/packages/14/b6/2d4540e740363746f4922584df9d7f342141e06814658cffd9eb7884d7b6/timethis-0.1.1.tar.gz" } ] }