{ "info": { "author": "Body Labs, Metabolize", "author_email": "github@paulmelnikow.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "harrison\n========\n\nTime a block of code.\n\n[![version](https://img.shields.io/pypi/v/harrison?style=flat-square)][pypi]\n[![python version](https://img.shields.io/pypi/pyversions/harrison?style=flat-square)][pypi]\n[![license](https://img.shields.io/pypi/l/harrison?style=flat-square)][pypi]\n[![build](https://img.shields.io/circleci/project/github/metabolize/harrison/master?style=flat-square)][build]\n[![code style](https://img.shields.io/badge/code%20style-black-black?style=flat-square)][black]\n\n[pypi]: https://pypi.org/project/harrison/\n[build]: https://circleci.com/gh/metabolize/harrison/tree/master\n[black]: https://black.readthedocs.io/en/stable/\n\nUse as the context expression of a `with` statement:\n\n```pyconsole\n>>> from harrison import Timer\n>>> with Timer() as t:\n>>> ...\n>>> print t.elapsed_time_ms\n12345\n```\n\nWhen a description string is passed on initialization, the elapsed time will\nbe printed on completion, keyed by this description.\n\n```pyconsole\n>>> with Timer('My expensive block of code'):\n>>> ...\nMy expensive block of code: 12345 ms\n```\n\nYou can also start and stop a Timer explicitly:\n\n```py\ntimer = Timer()\ntimer.start()\n\nsome_expensive_function(...)\nprint timer.elapsed_time_s\n\nanother_expensive_function(...)\ntimer.stop()\nprint timer.elapsed_time_s\n```\n\nYou can also time each execution of a function using a decorator:\n\n```py\nfrom harrison import profile\n\n@profile('Describes the function')\ndef some_function():\n pass\n\n# Without args, the function name (e.g. 'some_function') will be used\n# as the description.\n@profile()\ndef another_function():\n pass\n```\n\nYou can also use `RegisteredTimer`, which groups together a bunch of named\ntimers, provides utilities for serializing their times, and an optional global\ntimer registry.\n\nNamed after John Harrison, the English carpenter and clockmaker who\ninvented the [marine chronometer][].\n\n[John Harrison]: https://en.wikipedia.org/wiki/John_Harrison\n[marine chronometer]: https://en.wikipedia.org/wiki/Marine_chronometer\n\n\nSimilar libraries\n-----------------\n\nThis is similar to the library [contexttimer][], but that library is licensed\nunder the GPLv3 which is more restrictive than two-clause BSD license used\nhere.\n\n[contexttimer]: https://github.com/brouberol/contexttimer\n\n\nDevelopment\n-----------\n\n```sh\npip install -r requirements_dev.txt\nrake lint\n```\n\n\nContribute\n----------\n\n- Issue Tracker: https://github.com/metabolize/harrison/issues\n- Source Code: https://github.com/metabolize/harrison\n\nPull requests welcome!\n\n\nSupport\n-------\n\nIf you are having issues, please let us know.\n\n\nAcknowledgements\n----------------\n\nThis project was packaged by [Paul Melnikow][] while at [Body Labs][]. Thanks\nto Body Labs for the repository transfer.\n\n\n[paul melnikow]: https://github.com/paulmelnikow\n[body labs]: https://github.com/bodylabs\n\n\nLicense\n-------\n\nThe project is licensed under the two-clause BSD license.", "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/metabolize/harrison", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "harrison", "package_url": "https://pypi.org/project/harrison/", "platform": "", "project_url": "https://pypi.org/project/harrison/", "project_urls": { "Homepage": "https://github.com/metabolize/harrison" }, "release_url": "https://pypi.org/project/harrison/1.2.1/", "requires_dist": null, "requires_python": "", "summary": "Time a block of code", "version": "1.2.1" }, "last_serial": 5755725, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4094d7d718be8c496521ae7fb83095f1", "sha256": "8e01c3bcc0792385d9bd8e8f4ca696c11d17ab992e52f3177b7afe8295bb2b37" }, "downloads": -1, "filename": "harrison-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4094d7d718be8c496521ae7fb83095f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4501, "upload_time": "2016-05-16T19:17:41", "url": "https://files.pythonhosted.org/packages/1b/39/b2414b8e3634aa12f4b2064795830f49e32cc312bc62e274757387e6ec3e/harrison-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "881a09d87a0d8955765da642a1454a62", "sha256": "7e82284a1d77c57fd44a9ed9b7be04e19a396f781118e139e9313ee34feb0738" }, "downloads": -1, "filename": "harrison-1.1.0.tar.gz", "has_sig": false, "md5_digest": "881a09d87a0d8955765da642a1454a62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5783, "upload_time": "2016-06-10T17:17:46", "url": "https://files.pythonhosted.org/packages/b2/93/97c72793c20972d7f74528de9007d4311c5112c4d084ad77a29e063bce87/harrison-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "e36e8a0f517fb5efacd1d0a4356b21a5", "sha256": "059eb17bf59161f98ee3807a0bc1bd19b31ca919b7aa76d80a024b3fb226a65c" }, "downloads": -1, "filename": "harrison-1.1.1.tar.gz", "has_sig": false, "md5_digest": "e36e8a0f517fb5efacd1d0a4356b21a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5828, "upload_time": "2016-06-27T14:38:11", "url": "https://files.pythonhosted.org/packages/63/12/f4f7f8466f953a2c43546782d2c3f9a11749b551010316d809ee7ebedb38/harrison-1.1.1.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "f26c3d8c8f6e282d6dd6fc0d9d72fb47", "sha256": "d1e66c4fd4db5a11535521f6e61a5e5d0cf887cbaa85e01b14c5879eb25e9440" }, "downloads": -1, "filename": "harrison-1.2.1.tar.gz", "has_sig": false, "md5_digest": "f26c3d8c8f6e282d6dd6fc0d9d72fb47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6163, "upload_time": "2019-08-29T17:28:53", "url": "https://files.pythonhosted.org/packages/ac/02/119827337c55bdcf7345966f213668c6ce2f266e2a58fc2393086d7f1332/harrison-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f26c3d8c8f6e282d6dd6fc0d9d72fb47", "sha256": "d1e66c4fd4db5a11535521f6e61a5e5d0cf887cbaa85e01b14c5879eb25e9440" }, "downloads": -1, "filename": "harrison-1.2.1.tar.gz", "has_sig": false, "md5_digest": "f26c3d8c8f6e282d6dd6fc0d9d72fb47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6163, "upload_time": "2019-08-29T17:28:53", "url": "https://files.pythonhosted.org/packages/ac/02/119827337c55bdcf7345966f213668c6ce2f266e2a58fc2393086d7f1332/harrison-1.2.1.tar.gz" } ] }