{ "info": { "author": "Hector Sanchez", "author_email": "hector.direct@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# Tic Toc\n\nIt allows you to time some parts of your code in an easy way.\n\nYou can get it from pip.\n```python\npip install ttictoc\n```\n\n\n# How to use it\n\nFirst import the class\n```python\nfrom ttictoc import TicToc\n```\n\nNow, they are several ways to use it.\n\n### Using the 'with' statement\nWithout creating any object you can time your code as follow.\n```python\nwith TicToc('name'):\n some code...\n# Prints the elapsed time\n```\n\nOr by creating an object you can do de same.\n```python\nt = TicToc()\nwith t:\n some code...\n# Prints the elapsed time\n```\n\n### Calling tic toc explicitly\nYou can also call the tic toc explicitply as shown bellow.\n```python\nt = TicToc('name')\nt.tic()\nsome code...\nt.toc() # Prints and returns the elapsed time\nprint(t.elapsed)\n```\nor\n```python\nt = TicToc()\nt.tic()\nsome code...\nt.toc() # Prints and returns the elapsed time\n```\n\n### With nesting\nIf you want to time multiple levels of your code, you can also do it by setting 'nested' to True.\n```python\nt = TicToc(nested=True)\nt.tic()\nsome code1...\nt.tic()\nsome code2...\nt.tic()\nsome code3...\nt.toc() # Prints time for code 3 \nt.toc() # Prints time for code 2 with code 3\nt.toc() # Prints time for code 1 with code 2 and 3\n```\n\n### Not feeling like writing 't.'?\nYou could do as follow.\n```python\nt = TicToc()\ntic = t.tic\ntoc = t.toc\n\ntic()\nsome code...\ntoc()\n```\n\nEven better, just import them.\n```python\nfrom ttictoc import tic,toc\n```\nAnd use them.\n```python\ntic()\nsome code...\ntoc()\n```\n\nWhat about nested tic tocs?\n```python\ntic(nested=True)\nsome code1...\ntic(nested=True)\nsome code2...\ntoc() # Prints the time that took some code 2 to run\ntoc() # Prints the time that took some code 1 and 2 to run\n```\nor\n```python\ntic(nested=True)\nsome code1...\ntic()\nsome code2...\ntoc() # Prints the time that took some code 2 to run\ntoc() # Prints the time that took some code 1 and 2 to run\n```\nIt's the same.\n\n## Available methods\n- `set_print_toc`: Sets the global behaviour of toc about printing the elapsed time. However, if you use toc(print_elapsed=True), for that specific toc the elapsed time will be printed even if `set_print_toc` was put to `False`. \n- `set_nested`: Indicates if tic toc should allow nesting.\n\n```python\nfrom ttictoc import TicToc\nt = TicToc()\nt.set_nested(True)\nt.set_print_toc(False)\n```\n\n## Arguments\nThe class has 4 arguments: `name`,`method`,`nested`, and `print_toc`. \n- `name`: It's the name of the object. It's not required.\n- `method`: Indicates which method should be used to get the time.\n- `nested`: Allows to use the same object several times, in different indentations to time.\n- `print_toc`: Indicate if you want to print, or not, the elapsed time when calling toc.\n\nThe `method` argument can be either `int`, `str`, or your method choice. If it's a string, the valid values are `time`, `perf_counter`, and `process_time`. If it's an integer, the valid values are `0`, `1`, and `2`.\n\n- `time` or `0`: time.time\n\nIf python > 2\n\n- `perf_counter` or `1`: time.perf_counter\n- `process_time` or `2`: time.process_time\n\nIf python version >= 3.7:\n- `time_ns` or `3`: time.time_ns\n- `perf_counter_ns` or `4`: time.perf_counter_ns\n- `process_time_ns` or `5`: time.process_time_ns\n\nIn case you prefere to use other method you just do (using as example `time.clock`:\n```python\nTicToc(method=time.clock) \n```\n\n\n\n# How to \"pack it\"\nWiht the following command.\n```\npython setup.py sdist bdist_wheel\n```\n\n# How to put it on pip\n```\ntwine upload dist/*\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/hector-sab/ttictoc", "keywords": "tictoc tic toc time timing", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ttictoc", "package_url": "https://pypi.org/project/ttictoc/", "platform": "", "project_url": "https://pypi.org/project/ttictoc/", "project_urls": { "Homepage": "https://github.com/hector-sab/ttictoc" }, "release_url": "https://pypi.org/project/ttictoc/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "Time parts of your code easily.", "version": "0.4.1" }, "last_serial": 4125745, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "420f9cc220777106367da62f7519723d", "sha256": "1b1de5f9d930df1a19b3026932d89dbf82d9d0ecce67295f64b0692c308c47ef" }, "downloads": -1, "filename": "ttictoc-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "420f9cc220777106367da62f7519723d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3959, "upload_time": "2018-07-27T18:49:57", "url": "https://files.pythonhosted.org/packages/60/de/e3e9259742863c849b401665c38134644c82346c6728a2031ffd1cd9db94/ttictoc-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5cb56d4d37e1ff47b6259c6336219b60", "sha256": "971d39fe4771653aba3f966a4dd6f6030261fcde7889764fb61a8f27e05b4eed" }, "downloads": -1, "filename": "ttictoc-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5cb56d4d37e1ff47b6259c6336219b60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3430, "upload_time": "2018-07-27T18:49:58", "url": "https://files.pythonhosted.org/packages/74/76/0202ed1bc8a9b1464fc0193cad8a18a9bbcb009f8256d3f2a4d7791a63fd/ttictoc-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1f1f37a16cca8c808b881a38aef3e3f8", "sha256": "5bcabbd35970d2a5ad6f04f5e61e6e06d46e7b234b232e63bf64139e89bb8a17" }, "downloads": -1, "filename": "ttictoc-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1f1f37a16cca8c808b881a38aef3e3f8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4325, "upload_time": "2018-07-28T23:58:24", "url": "https://files.pythonhosted.org/packages/27/d9/9593fd6b049b7961d487e6ec8df46e384f8977faf76e36cce6e8fda9db6a/ttictoc-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "846db717c92223c35761c7c5e58bd621", "sha256": "d63d37dd13775eec76d7700cf9c6b734a06e4a66cccf0b06b97cf36fb5a095b3" }, "downloads": -1, "filename": "ttictoc-0.2.0.tar.gz", "has_sig": false, "md5_digest": "846db717c92223c35761c7c5e58bd621", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3817, "upload_time": "2018-07-28T23:58:25", "url": "https://files.pythonhosted.org/packages/72/ab/5dde018f00c7f0738dc3358e3b3715232165863be22147024219740b53d5/ttictoc-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "bf1e8270f02c90c113c0a9d2701c0120", "sha256": "8bc043b0bbff065e803fce3673c8b7229af5a009141b29bdca6e79c6bee212fb" }, "downloads": -1, "filename": "ttictoc-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "bf1e8270f02c90c113c0a9d2701c0120", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4844, "upload_time": "2018-07-29T01:07:35", "url": "https://files.pythonhosted.org/packages/26/e4/8caf5831b5185973a761c21e41a2414fc2167985d033dbe24064bca9cd86/ttictoc-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "947143e50a0f3f3d9f29f6f04aff618e", "sha256": "db4d26aed28a3046c8e43f8ebc85fa2bc752efaaf4a8fb163d49d6c1e1679473" }, "downloads": -1, "filename": "ttictoc-0.3.0.tar.gz", "has_sig": false, "md5_digest": "947143e50a0f3f3d9f29f6f04aff618e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4445, "upload_time": "2018-07-29T01:07:36", "url": "https://files.pythonhosted.org/packages/18/9b/f61f81740ccce0bc6afffbd750200e7765bb6beeab4224efa4e32e8318ec/ttictoc-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "564f090e2adbdfc0db71cc6abb2fbea9", "sha256": "a767bf9698e81d75fbd1a75e204b998cf5fcfb5d4b167a6f761c384f7dd5ce18" }, "downloads": -1, "filename": "ttictoc-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "564f090e2adbdfc0db71cc6abb2fbea9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4865, "upload_time": "2018-07-29T01:29:46", "url": "https://files.pythonhosted.org/packages/04/ad/efc9ebde06f1da7d28b90e402c1cdf5b275300ef8a631613691331d7f087/ttictoc-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3f5a56d3c42a1f200cea704e0c38bb33", "sha256": "659d866d79db83cc6bdee19249ef87ca257cb33a006e7c31eb1f7d58d99143de" }, "downloads": -1, "filename": "ttictoc-0.3.1.tar.gz", "has_sig": false, "md5_digest": "3f5a56d3c42a1f200cea704e0c38bb33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4469, "upload_time": "2018-07-29T01:29:48", "url": "https://files.pythonhosted.org/packages/5d/65/9a4e2cce917a20447fa876574346845417fe19f32e87b19381cd1076d412/ttictoc-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "59acf9c987782468aedf9ba1edcc3caf", "sha256": "986b17ef275cbfa79db8a35e86f8ba1c820d78622198d4b08135d887964b8371" }, "downloads": -1, "filename": "ttictoc-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "59acf9c987782468aedf9ba1edcc3caf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4961, "upload_time": "2018-07-30T17:36:20", "url": "https://files.pythonhosted.org/packages/04/d9/c480282f0a38526bb3299751d62db26c86b5ab77b9210646b01e56f037c2/ttictoc-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e2dbdabd96dd33869708bda103d9a244", "sha256": "9147e83d07adc49bd95adc6ec8b147e49e5546da5d5a6adc9b8a4866466efcd8" }, "downloads": -1, "filename": "ttictoc-0.3.2.tar.gz", "has_sig": false, "md5_digest": "e2dbdabd96dd33869708bda103d9a244", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4587, "upload_time": "2018-07-30T17:36:21", "url": "https://files.pythonhosted.org/packages/e0/2c/4e512248752943906d2db35d97a2a7f05f41599f63623aebabe7844fc392/ttictoc-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "de457c9357a88bcd93fe5c67bc0c7e7c", "sha256": "9f8941ae43a2249ca20bc57dc1008e74dbbec0b380a65a6d8bfa79015542ec7a" }, "downloads": -1, "filename": "ttictoc-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "de457c9357a88bcd93fe5c67bc0c7e7c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4960, "upload_time": "2018-07-30T18:29:16", "url": "https://files.pythonhosted.org/packages/a4/3d/48e3cf41a8872fe008c02000965e458886237ce6e194b479ca4acde8b3f6/ttictoc-0.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de190a87541020fc581710dd4ce17878", "sha256": "a4c50fdc8cf00392b25f79951925be4c52d559fc34b1cc38dcfbd2a4a7993ec3" }, "downloads": -1, "filename": "ttictoc-0.3.3.tar.gz", "has_sig": false, "md5_digest": "de190a87541020fc581710dd4ce17878", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4577, "upload_time": "2018-07-30T18:29:18", "url": "https://files.pythonhosted.org/packages/cc/ce/bffa5365fddfcb5ed3c6673f6d6d57a8a6811905eb2efdaf2e0480a6cfec/ttictoc-0.3.3.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "24c351689c470f4e474b9f2166cb2ed4", "sha256": "80a04660f9578b4195bee264f4bf798e21b49233a7ec86e27dea22287ab66bed" }, "downloads": -1, "filename": "ttictoc-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "24c351689c470f4e474b9f2166cb2ed4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4985, "upload_time": "2018-08-01T17:39:34", "url": "https://files.pythonhosted.org/packages/bd/ce/f557f4bd14b214096f6f86baf3eea7a16e46b8e2fc8b577067f1d34cb065/ttictoc-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "641308ab8220879b726f505352898cdb", "sha256": "13869e93246bc555aaf9b692d974d6a155ecd8ee775baa91e754be2fd3972daa" }, "downloads": -1, "filename": "ttictoc-0.4.0.tar.gz", "has_sig": false, "md5_digest": "641308ab8220879b726f505352898cdb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4607, "upload_time": "2018-08-01T17:39:35", "url": "https://files.pythonhosted.org/packages/09/f2/5b1c78ca5747f73c093cbfde1b8d30ae2885f25be70a739172a72c246198/ttictoc-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "b972e54dd970cc1e1e723d4b57502e3c", "sha256": "8da441c041f9dbb543b3f57a0964ad635d679e3e68ec17c91f678658027610e2" }, "downloads": -1, "filename": "ttictoc-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b972e54dd970cc1e1e723d4b57502e3c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4985, "upload_time": "2018-08-01T18:16:27", "url": "https://files.pythonhosted.org/packages/cd/55/b40934afe43119c3c6cd08281885c6835ca610735a64ce51f79ae2ba47aa/ttictoc-0.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d25625318645e024051a46d1e3da7963", "sha256": "ce18553edf8443358d675a75aa168caee51383eec274322ff230dd634c27114e" }, "downloads": -1, "filename": "ttictoc-0.4.1.tar.gz", "has_sig": false, "md5_digest": "d25625318645e024051a46d1e3da7963", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4609, "upload_time": "2018-08-01T18:16:27", "url": "https://files.pythonhosted.org/packages/64/e9/c42b3626c2917832e6453868a6eb40ea5bfb7417c72a7f5c683abd49385b/ttictoc-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b972e54dd970cc1e1e723d4b57502e3c", "sha256": "8da441c041f9dbb543b3f57a0964ad635d679e3e68ec17c91f678658027610e2" }, "downloads": -1, "filename": "ttictoc-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b972e54dd970cc1e1e723d4b57502e3c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4985, "upload_time": "2018-08-01T18:16:27", "url": "https://files.pythonhosted.org/packages/cd/55/b40934afe43119c3c6cd08281885c6835ca610735a64ce51f79ae2ba47aa/ttictoc-0.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d25625318645e024051a46d1e3da7963", "sha256": "ce18553edf8443358d675a75aa168caee51383eec274322ff230dd634c27114e" }, "downloads": -1, "filename": "ttictoc-0.4.1.tar.gz", "has_sig": false, "md5_digest": "d25625318645e024051a46d1e3da7963", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4609, "upload_time": "2018-08-01T18:16:27", "url": "https://files.pythonhosted.org/packages/64/e9/c42b3626c2917832e6453868a6eb40ea5bfb7417c72a7f5c683abd49385b/ttictoc-0.4.1.tar.gz" } ] }