{ "info": { "author": "Siddhant Chhabra ", "author_email": "siddhant1042@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# Execution-Time\n\n[![Build Status](https://travis-ci.org/siddhant-curious/Execution-Time.svg?branch=master)](https://travis-ci.org/siddhant-curious/Execution-Time)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/siddhant-curious/Execution-Time/blob/master/LICENSE)\n\nThis is a tiny python package which provides you with a decorator to measure execution time of functions. \n\n## Installation\n\nYou should be able to install using `pip` in the usual ways:\n\n```sh\n$ pip install execution-time\n```\n\nOr just clone this repository and run:\n\n```sh\n$ python3 setup.py install\n```\n\nOr place the `execution_time` folder that you downloaded somewhere where it can be accessed by your scripts.\n\n## Basic Usage\n\nImport the class `ExecutionTime`, instantiate it and `@obj.timeit` decorater becomes available. \n\n```python\nfrom execution_time import ExecutionTime\ne = ExecutionTime()\n\n@e.timit\ndef foo(arg1):\n do_something(arg1) \n return \n\n@e.timeit\ndef bar():\n hello_world()\n return\n\nfoo(\"dragons\")\nbar()\nprint(e.logdata_time)\n\n## {'foo': 0.12000000000012001, 'bar': 0.11650000000007488}\n\n```\n`logdata_time` is a dictionary which contains the data in `methodname:time took in ms` format. \n\n## Additonal Features\n\n1. Auto-Decorate all functions in a script. \n\nThis is a shortcut if you want to auto-deocreate all function. To do so, pass the `__name__` attribute to the class instantiation as: \n\n```python\nfrom execution_time import ExecutionTime\n\ndef foo():\n do_something()\n return \n\ndef bar():\n hi()\n\ne = ExecutionTime(module_name=__name__)\n\nfoo()\nbar()\n\nprint(e.logdata_time)\n```\nNote: The class instantiation must be done after functions have been defined and before they are called. This does limit where this feature can be used and the decorator approach is recommeneded in those scenarios. \n\n2. Provide console logs. \n\n```python\ne = ExecutionTime(console=True)\n```\n\nOutput the log time in console as: `2019-07-06 22:07:55,157 [INFO ] Time take by method : foo is 0.12000000000012001 ms`\n\n## Issues\n\nYou can report the bugs at the [issue tracker](https://github.com/siddhant-curious/Execution-Time/issues)\n\n## License\n\nBuilt with \u00e2\u2122\u00a5 by Siddhant Chhabra([@siddhant-curious](https://github.com/siddhant-curious)) under [MIT License](https://github.com/siddhant-curious/Execution-Time/blob/master/LICENSE)\n\nYou can find a copy of the License at \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/siddhant-curious/Python-Method-Execution-Time", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Execution-Time", "package_url": "https://pypi.org/project/Execution-Time/", "platform": "", "project_url": "https://pypi.org/project/Execution-Time/", "project_urls": { "Homepage": "https://github.com/siddhant-curious/Python-Method-Execution-Time" }, "release_url": "https://pypi.org/project/Execution-Time/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "package which provides you with a decorator to measure execution time of functions", "version": "1.0.0" }, "last_serial": 5495333, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0f5a7b18ed01ff6ef9497b440c12fe83", "sha256": "502f5fd18ced0516e58f00b503f62182d1acf89d41b7232ae25bec89a63fafa0" }, "downloads": -1, "filename": "Execution_Time-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0f5a7b18ed01ff6ef9497b440c12fe83", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5038, "upload_time": "2019-07-06T18:26:30", "url": "https://files.pythonhosted.org/packages/ec/20/ecf62606e571461f84a40d16c519136d69e89e8b5b0f2f8857dd10247665/Execution_Time-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06f8c4c873b16cfbf2672731d5f4f2d8", "sha256": "8214330ed72fa66bed55a2c71382e619eb6043855c44412b499e984044734998" }, "downloads": -1, "filename": "Execution Time-1.0.0.tar.gz", "has_sig": false, "md5_digest": "06f8c4c873b16cfbf2672731d5f4f2d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3513, "upload_time": "2019-07-06T18:26:32", "url": "https://files.pythonhosted.org/packages/c1/cd/5d46b870ceb6614fea748e0b1489bf2ad412e9296f737e2bbac510eecebb/Execution%20Time-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0f5a7b18ed01ff6ef9497b440c12fe83", "sha256": "502f5fd18ced0516e58f00b503f62182d1acf89d41b7232ae25bec89a63fafa0" }, "downloads": -1, "filename": "Execution_Time-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0f5a7b18ed01ff6ef9497b440c12fe83", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5038, "upload_time": "2019-07-06T18:26:30", "url": "https://files.pythonhosted.org/packages/ec/20/ecf62606e571461f84a40d16c519136d69e89e8b5b0f2f8857dd10247665/Execution_Time-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06f8c4c873b16cfbf2672731d5f4f2d8", "sha256": "8214330ed72fa66bed55a2c71382e619eb6043855c44412b499e984044734998" }, "downloads": -1, "filename": "Execution Time-1.0.0.tar.gz", "has_sig": false, "md5_digest": "06f8c4c873b16cfbf2672731d5f4f2d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3513, "upload_time": "2019-07-06T18:26:32", "url": "https://files.pythonhosted.org/packages/c1/cd/5d46b870ceb6614fea748e0b1489bf2ad412e9296f737e2bbac510eecebb/Execution%20Time-1.0.0.tar.gz" } ] }