{ "info": { "author": "Body Labs", "author_email": "david.smith@bodylabs.com, paul.melnikow@bodylabs.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\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/bodylabs/harrison/issues\n- Source Code: https://github.com/bodylabs/harrison\n\nPull requests welcome!\n\n\nSupport\n-------\n\nIf you are having issues, please let us know.\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": "metaboharrison", "package_url": "https://pypi.org/project/metaboharrison/", "platform": "", "project_url": "https://pypi.org/project/metaboharrison/", "project_urls": { "Homepage": "https://github.com/metabolize/harrison" }, "release_url": "https://pypi.org/project/metaboharrison/1.2.0/", "requires_dist": null, "requires_python": "", "summary": "Time a block of code", "version": "1.2.0" }, "last_serial": 5743764, "releases": { "1.2.0": [ { "comment_text": "", "digests": { "md5": "dbe21c25efa88b3cc62d243d14f5616b", "sha256": "04aba6c0ca2c0c94c66d2a34c5376aefd60b703769b94335ba0f89e5bcd4a952" }, "downloads": -1, "filename": "metaboharrison-1.2.0.tar.gz", "has_sig": false, "md5_digest": "dbe21c25efa88b3cc62d243d14f5616b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5877, "upload_time": "2019-08-28T16:39:08", "url": "https://files.pythonhosted.org/packages/79/87/6e651781d1ba2be3a3821a146968bc0faa4967d8c2686c08e4cc3bb57ffa/metaboharrison-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dbe21c25efa88b3cc62d243d14f5616b", "sha256": "04aba6c0ca2c0c94c66d2a34c5376aefd60b703769b94335ba0f89e5bcd4a952" }, "downloads": -1, "filename": "metaboharrison-1.2.0.tar.gz", "has_sig": false, "md5_digest": "dbe21c25efa88b3cc62d243d14f5616b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5877, "upload_time": "2019-08-28T16:39:08", "url": "https://files.pythonhosted.org/packages/79/87/6e651781d1ba2be3a3821a146968bc0faa4967d8c2686c08e4cc3bb57ffa/metaboharrison-1.2.0.tar.gz" } ] }