{ "info": { "author": "GoldenCorgi", "author_email": "", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# JustTimeit.py\n\n---\n\n[![License](https://img.shields.io/badge/license-GLWT-green.svg)](https://github.com/goldencorgi/justtimeit/LICENSE) [![Coverage Status](https://coveralls.io/repos/github/GoldenCorgi/just-time-it/badge.svg?branch=master)](https://coveralls.io/github/GoldenCorgi/just-time-it?branch=master) [![Build Status](https://travis-ci.com/GoldenCorgi/just-time-it.svg?branch=master)](https://travis-ci.com/GoldenCorgi/just-time-it) [![GitHub file size in bytes](https://img.shields.io/github/size/GoldenCorgi/just-time-it/timefunctions/__init__.py.svg)](https://github.com/GoldenCorgi/just-time-it/blob/master/timefunctions/__init__.py) [![Python Version](https://img.shields.io/badge/python-3.6%20%7C%203.7-blue.svg)](https://github.com/GoldenCorgi/just-time-it) ![Dependencies](https://img.shields.io/badge/dependencies-none-brightgreen.svg) [![My Looks](https://img.shields.io/badge/handsome-110%25-blue.svg)](https://www.google.com/search?q=park+hyung+sik) ![OwO](https://img.shields.io/badge/OwO-what's%20this-blueviolet.svg)\n\nDon't have enough dependencies with poor documentation in your projects? Have an undying desire for more broken code for important functions? Eat cereal with water? Or just an all-round masochist? (Just kidding, we're all programmers, we're all masochists)\n\nBoy, do I have the solution for you.\n\n## Hurt me harder daddy\n\nToo lazy to wrap your functions with this?\n\n```python\nimport time\nstarttime = time.time()\ndef shakyRelationship(Wallet):\n while True:\n if Wallet == \"empty\":\n break\n elif Wallet == \"thicc\":\n # stop lying to yourself\n break\n return \"big sad\"\nYourWallet = \"empty\"\nresult = shakyRelationship(YourWallet)\nprint(time.time()-starttime)\n>>> 1.0940176924541224e-06\n```\n\nNow you can wrap it like this\n\n``` python\nfrom timefunctions import timefunc\nMyWallet = \"thicc\"\nresult = timefunc(\"shakyRelationship(MyWallet)\",globals=globals()) # Only include globals() if you have variables\n>>> Time Taken for yourfunction: 1.0940176924541224e-06 . Repeated 1 time(s).\n```\n\nThis package can't save your relationships but it can save you that 3 seconds.\n\nNow you can go spend more time learning Tensorflow for that interesting python uncensoring project.\n\n## Requirements\n\nPython3.6+. Have anything older than Python3.6? You're either working corporate (see: [FAQ](#FAQ)) or a masochist (see: [Support/Personal Issues](#Support))\n\n## Installation\n\n```python\npip install just-time-it\n```\n\n## Quickstart/Documentation\n\nLets define a example function\n\n```python\ndef multiply(x,y):\n return x*y\n```\n\n### printr=0 (default)\n\nPrint function name without arguments\n\n```python\nfrom timefunctions import timefunc\nresult = timefunc(\"multiply(3,5)\")\n>>> Time Taken for multiply: 1.0940176924541224e-06 . Repeated 1 time(s).\n```\n\n### printr=1\n\nPrint Function name with arguments\n\n```python\nfrom timefunctions import timefunc\nresult = timefunc(\"multiply(3,5)\",printr=1)\n>>> Time Taken for multiply(3,5): 1.0940176924541224e-06 . Repeated 1 time(s).\n```\n\n### printr=2\n\nPrint nothing\n\n```python\nfrom timefunctions import timefunc\nresult = timefunc(\"multiply(3,5)\",printr=2)\n>>>\n```\n\n### returnr=0 (default)\n\nReturn the result of your function\n\n```python\nfrom timefunctions import timefunc\nresult = timefunc(\"multiply(3,5)\")\nprint(result)\n>>> Time Taken for multiply(3,5): 1.0940176924541224e-06 . Repeated 1 time(s).\n>>> 15\n```\n\n### returnr=1\n\nReturn the time taken for the function to complete\n\n```python\nfrom timefunctions import timefunc\nresult = timefunc(\"multiply(3,5)\",returnr=1)\nprint(result)\n>>> Time Taken for multiply(3,5): 1.0940176924541224e-06 . Repeated 1 time(s).\n>>> 1.0940176924541224e-06\n```\n\n### returnr=2\n\nReturn both result and time taken\n\n```python\nfrom timefunctions import timefunc\nresult = timefunc(\"multiply(3,5)\",returnr=2)\nprint(result)\n>>> Time Taken for multiply(3,5): 1.0940176924541224e-06 . Repeated 1 time(s).\n>>> (1.0940176924541224e-06,15)\n```\n\n### returnr=2,printr=2\n\nReturn result and time taken without printing anything\n\n```python\nfrom timefunctions import timefunc\nresult = timefunc(\"multiply(3,5)\",printr=2,returnr=2)\nprint(result)\n>>> (1.0940176924541224e-06,15)\n```\n\n### Globals\n\nHave variables? use globals=globals()\n\n```python\nfrom timefunctions import timefunc\nx=3\ny=5\nresult = timefunc(\"multiply(x,y)\",globals=globals())\nprint(result)\n>>> Time Taken for multiply(x,y): 1.0940176924541224e-06 . Repeated 1 time(s).\n```\n\n## Technology\n\nJustTimeit.py uses Object-Oriented, Dynamic Programming, Augmented Reality, Machine Learning, Artificial Neural Networks, GPT-2 and my Big Data to ensure you save that 3 seconds.\n\n## Testing\n\ngood joke\n\n## Support\n\nFor Technical Issues: www.stackoverflow.com\n\nFor Personal Issues: Sounds like your own personal problem, let's keep it that way.\n\n## FAQ\n\n> Should I use this?\n\nNo, this is like the worst possible combination of words to ever grace this Earth.\n\n> Can I change the README to be more professional?\n\nI'll put this entire file through an OwO generator if you try\n\n> I'm a born masochist, I still use Python2.3. Will there be support for Python3.5 or other earlier depreciated versions?\n\nIf I wanted to torture myself with compatibility issues, I might as well go into the dating scene.\n\n## Caveats/Warnings (Serious)\n\nThis code is not accurate. Any function you are testing that is under 0.1 seconds should NOT rely on this package. A normal function that executes for around 0.9 seconds will look like this under different code\n\n### Example slow code\n\n```python\n# Around 0.9 seconds to run\ndef multiply(x,y):\n for d in range(10000000):\n xy = d*x*y\n return None\n```\n\n### Normal time.time()\n\n```python\nstarttime = time.time()\nmultiply(3,7)\nprint(\"time.time()\",(time.time()-starttime))\n>>> time.time() 0.8946394920349121\n```\n\n### timeit with setup\n\n```python\nprint(\"timesetup\",timeit.timeit(\"multiply(3,7)\",setup=\"from /__main__ import multiply\",number=ss))\n>>> timesetup 0.9034562206940011\n```\n\n### timefunc (this package)\n\n```python\ntimefunc(\"multiply(3,7)\")\n>>> Time Taken for multiply: 0.84726418995648 . Repeated 1 time(s).\n```\n\nThey are roughly similar with a maximum of 0.1 differences. You can try altering range(10000000) to see the differences in the code.\n\n## License\n\n---\n\nGLWT(Good Luck With That) Public License\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/GoldenCorgi/just-time-it", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "just-time-it", "package_url": "https://pypi.org/project/just-time-it/", "platform": "", "project_url": "https://pypi.org/project/just-time-it/", "project_urls": { "Homepage": "https://github.com/GoldenCorgi/just-time-it" }, "release_url": "https://pypi.org/project/just-time-it/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "The fuss-free way to time functions", "version": "0.1.2" }, "last_serial": 5291310, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "3d36aab10ee7f6d44846ce8bbd334535", "sha256": "61a5f1db7187b9d8edf15cda8a985776e19ab815c12e691c22fe5686cb5c95a6" }, "downloads": -1, "filename": "just_time_it-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3d36aab10ee7f6d44846ce8bbd334535", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5559, "upload_time": "2019-05-20T09:37:16", "url": "https://files.pythonhosted.org/packages/c0/d7/2f023654bed2a0c316d24266add077ff6b7ab85d433b2058031336748cf2/just_time_it-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3ea0ceb0d1aa9ba9366554c29b2f5038", "sha256": "424c3aa28dc3e74a6cdc133245a1f32d5c54d6272a2e162cb896762859c01b11" }, "downloads": -1, "filename": "just-time-it-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3ea0ceb0d1aa9ba9366554c29b2f5038", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4409, "upload_time": "2019-05-20T09:37:18", "url": "https://files.pythonhosted.org/packages/1b/ee/0b52d25eaa0a93143287ade24c284b0b31c9b283a48e1ff235ecd0222714/just-time-it-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3d36aab10ee7f6d44846ce8bbd334535", "sha256": "61a5f1db7187b9d8edf15cda8a985776e19ab815c12e691c22fe5686cb5c95a6" }, "downloads": -1, "filename": "just_time_it-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3d36aab10ee7f6d44846ce8bbd334535", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5559, "upload_time": "2019-05-20T09:37:16", "url": "https://files.pythonhosted.org/packages/c0/d7/2f023654bed2a0c316d24266add077ff6b7ab85d433b2058031336748cf2/just_time_it-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3ea0ceb0d1aa9ba9366554c29b2f5038", "sha256": "424c3aa28dc3e74a6cdc133245a1f32d5c54d6272a2e162cb896762859c01b11" }, "downloads": -1, "filename": "just-time-it-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3ea0ceb0d1aa9ba9366554c29b2f5038", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4409, "upload_time": "2019-05-20T09:37:18", "url": "https://files.pythonhosted.org/packages/1b/ee/0b52d25eaa0a93143287ade24c284b0b31c9b283a48e1ff235ecd0222714/just-time-it-0.1.2.tar.gz" } ] }