{ "info": { "author": "Chris Reed", "author_email": "flit@me.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Other/Nonlisted Topic", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "elapsedtimer\n============\n\nPython elapsed time utilities.\n\nThe main interface to this package is an ``ElapsedTimer`` class. This class will use the highest\nresolution timer available to Python depending on the OS, either ``time.time()`` or\n``time.clock()``. Its purpose is easily to measure and print the duration of a task, and is\nnormally meant to be used as a context manager.\n\nBasic example:\n\n >>> with ElapsedTimer('say hello'):\n ... print 'hi there!'\n hi there!\n 13.113 \u00b5s: say hello\n\nElapsedTimer\n------------\n\nThe constructor for ``ElapsedTimer`` takes an optional string describing the operation being\nperformed. It also optionally accepts a file object to change where the resulting duration\nmessage will be printed. The output file defaults to sys.stdout.\n\nThe constructor can also take a logger instance and log level via the optional ``logger`` and\n``loglevel`` keyword parameters. If a logger is provided, it takes precedence over a file object\nand the duration message will be output via the logger. The log level defaults to ``DEBUG``.\n\nYou can control an ``ElapsedTimer`` instance directly instead of using it as a context manager.\nIt has ``start()`` and ``stop()`` methods. The ``stop()`` method will not print the duration for\nyou like exiting a context manager instance does.\n\nThere is an ``elapsed`` property that returns the elapsed time since ``start()`` was called or the\ncontext manager entered. A ``timedelta`` property is also available that returns the elapsed\ntime as a datetime.timedelta object instead of a float, though note that this class this only has\nmicrosecond resolution.\n\nThere is a module-level ``enable`` variable that acts as a global enable switch for all printing\nof results by ``ElapsedTimer``. It defaults to True.\n\nTimeout\n-------\n\nAnother class in the module is ``Timeout``. It adds a few methods to make it easy to check for\ntimeouts. You can use this class as a context manager. The constructor takes the same parameters\nas for ``ElapsedTimer``, except for a new first param of the timeout in seconds.\n\nThere are two methods to check the timeout, ``check()`` and ``check_and_raise()``. The former\ncompares the elapsed time against the timeout and returned True if a timeout occurred. The latter\nwill raise ``TimeoutError`` if a timeout happens. You can use the ``timed_out`` property to\nas another way to check, equivalent to calling ``check()``.\n\n\nLicense\n-------\n\nThis package is licensed under the BSD three-clause license. See the LICENSE file for details.\n\nCopyright \u00a9 2014-2016 Chris Reed.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/flit/elapsedtimer", "keywords": "", "license": "BSD 3-Clause", "maintainer": "", "maintainer_email": "", "name": "elapsedtimer", "package_url": "https://pypi.org/project/elapsedtimer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/elapsedtimer/", "project_urls": { "Homepage": "https://github.com/flit/elapsedtimer" }, "release_url": "https://pypi.org/project/elapsedtimer/0.4/", "requires_dist": null, "requires_python": "", "summary": "Elapsed timer and utilities", "version": "0.4" }, "last_serial": 2407934, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "6207070c8ac1b461b631046ff4205e73", "sha256": "184dbe1dd25a89af1b41769de91caf7097c4d736d4075242340e0d9c55742a7e" }, "downloads": -1, "filename": "elapsedtimer-0.1.tar.gz", "has_sig": false, "md5_digest": "6207070c8ac1b461b631046ff4205e73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3030, "upload_time": "2015-07-04T19:16:28", "url": "https://files.pythonhosted.org/packages/cd/aa/1763bea84fcb221cf7931287db1e7b3468b46dec1c80010934453483665b/elapsedtimer-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f0a84f6786af9b22d1181f755832d01d", "sha256": "bf4eb00a2750dd09ec54cbf745544c700d99c57311199d0222b7c4e41e67c0f7" }, "downloads": -1, "filename": "elapsedtimer-0.2.tar.gz", "has_sig": false, "md5_digest": "f0a84f6786af9b22d1181f755832d01d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5099, "upload_time": "2015-07-07T15:42:16", "url": "https://files.pythonhosted.org/packages/4e/d0/6c87e26e6351f8e67e6b4d748c49b38a8b8180ce4a0493e3a7c0b3ba3e66/elapsedtimer-0.2.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "3ce1cca089ab69f3c1c1f54f68fe8663", "sha256": "4dd62e927e1a85c5ad8a6a6cd5b9bd4e28620e897b9195406047f99ca8d27eab" }, "downloads": -1, "filename": "elapsedtimer-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3ce1cca089ab69f3c1c1f54f68fe8663", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6694, "upload_time": "2016-10-18T17:53:23", "url": "https://files.pythonhosted.org/packages/48/a7/0a875e6bf56f89ff7835e0c21082d7da999eef008d0aa5091a796c8408ca/elapsedtimer-0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dffac13f9eb717694e5ee12c8698479c", "sha256": "e4cdaba86e539de29099056d2570bd6938b27f946766c1cdd4530666995e23f8" }, "downloads": -1, "filename": "elapsedtimer-0.4.tar.gz", "has_sig": false, "md5_digest": "dffac13f9eb717694e5ee12c8698479c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5349, "upload_time": "2016-10-18T17:53:25", "url": "https://files.pythonhosted.org/packages/80/1d/283794892b70d3d3db420a70d1f101e5f619b2d00fbcc64721371011755a/elapsedtimer-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3ce1cca089ab69f3c1c1f54f68fe8663", "sha256": "4dd62e927e1a85c5ad8a6a6cd5b9bd4e28620e897b9195406047f99ca8d27eab" }, "downloads": -1, "filename": "elapsedtimer-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3ce1cca089ab69f3c1c1f54f68fe8663", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6694, "upload_time": "2016-10-18T17:53:23", "url": "https://files.pythonhosted.org/packages/48/a7/0a875e6bf56f89ff7835e0c21082d7da999eef008d0aa5091a796c8408ca/elapsedtimer-0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dffac13f9eb717694e5ee12c8698479c", "sha256": "e4cdaba86e539de29099056d2570bd6938b27f946766c1cdd4530666995e23f8" }, "downloads": -1, "filename": "elapsedtimer-0.4.tar.gz", "has_sig": false, "md5_digest": "dffac13f9eb717694e5ee12c8698479c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5349, "upload_time": "2016-10-18T17:53:25", "url": "https://files.pythonhosted.org/packages/80/1d/283794892b70d3d3db420a70d1f101e5f619b2d00fbcc64721371011755a/elapsedtimer-0.4.tar.gz" } ] }