syct


Namesyct JSON
Version 0.4.5 PyPI version JSON
download
home_pagehttps://github.com/nadavo/Timer.git
SummaryA Simple Yet Convenient Timer module for Python 3
upload_time2024-08-23 09:33:09
maintainerNone
docs_urlNone
authorNadav Oved
requires_python>=3
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Simple Yet Convenient Timer for Python 3

### Installation
```
pip install syct
```

### Common Usage

#### Wrap a function with the `@timer` function decorator:
```
from syct import timer

@timer
def test_timer_decorator():
    sleep(5)
```
Calling the function will produce the following output:
```
<timestamp> - Started test_timer_decorator
<timestamp> - test_timer_decorator took 5.00 seconds to complete
```

#### Wrap a block of code using `with Timer`:
```
from syct import Timer

with Timer("with Timer block"):
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
```
Will produce the following output:
```
<timestamp> - Started with Timer block
<timestamp> - with Timer block took 5.00 seconds to complete
```

#### Create a custom `Timer` object in your code:
```
from syct import Timer

timer_test = Timer("Timer Testing")
sleep(5)
timer_test.stop()
```
Will produce the following output:
```
<timestamp> - Started Timer Testing
<timestamp> - Timer Testing took 5.00 seconds to complete
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nadavo/Timer.git",
    "name": "syct",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": null,
    "author": "Nadav Oved",
    "author_email": "nadavo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/17/c2/82e1b3cbfd291437305bbcca4956a0bec76d5ca8b9ecb1d8e994062bccdf/syct-0.4.5.tar.gz",
    "platform": null,
    "description": "# Simple Yet Convenient Timer for Python 3\n\n### Installation\n```\npip install syct\n```\n\n### Common Usage\n\n#### Wrap a function with the `@timer` function decorator:\n```\nfrom syct import timer\n\n@timer\ndef test_timer_decorator():\n    sleep(5)\n```\nCalling the function will produce the following output:\n```\n<timestamp> - Started test_timer_decorator\n<timestamp> - test_timer_decorator took 5.00 seconds to complete\n```\n\n#### Wrap a block of code using `with Timer`:\n```\nfrom syct import Timer\n\nwith Timer(\"with Timer block\"):\n    sleep(1)\n    sleep(1)\n    sleep(1)\n    sleep(1)\n    sleep(1)\n```\nWill produce the following output:\n```\n<timestamp> - Started with Timer block\n<timestamp> - with Timer block took 5.00 seconds to complete\n```\n\n#### Create a custom `Timer` object in your code:\n```\nfrom syct import Timer\n\ntimer_test = Timer(\"Timer Testing\")\nsleep(5)\ntimer_test.stop()\n```\nWill produce the following output:\n```\n<timestamp> - Started Timer Testing\n<timestamp> - Timer Testing took 5.00 seconds to complete\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Simple Yet Convenient Timer module for Python 3",
    "version": "0.4.5",
    "project_urls": {
        "Homepage": "https://github.com/nadavo/Timer.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4a82bc0ba7ab1ce14298be611ec261a42ac2f6ccfb2c536605138e2f2fddfa2b",
                "md5": "727853b5f087564f673791ce4afa6ab8",
                "sha256": "3708f142214f2dea4df87378166a2cea2ef290362893e7eecab9a80c18d18d84"
            },
            "downloads": -1,
            "filename": "syct-0.4.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "727853b5f087564f673791ce4afa6ab8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 3828,
            "upload_time": "2024-08-23T09:33:08",
            "upload_time_iso_8601": "2024-08-23T09:33:08.793528Z",
            "url": "https://files.pythonhosted.org/packages/4a/82/bc0ba7ab1ce14298be611ec261a42ac2f6ccfb2c536605138e2f2fddfa2b/syct-0.4.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "17c282e1b3cbfd291437305bbcca4956a0bec76d5ca8b9ecb1d8e994062bccdf",
                "md5": "8228e3bf45de5637df354639953fed70",
                "sha256": "7da3c936e9be1c96f9c0ed5fcca85a8a36f1acfb85d5844433281d1b547d1386"
            },
            "downloads": -1,
            "filename": "syct-0.4.5.tar.gz",
            "has_sig": false,
            "md5_digest": "8228e3bf45de5637df354639953fed70",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 4003,
            "upload_time": "2024-08-23T09:33:09",
            "upload_time_iso_8601": "2024-08-23T09:33:09.953839Z",
            "url": "https://files.pythonhosted.org/packages/17/c2/82e1b3cbfd291437305bbcca4956a0bec76d5ca8b9ecb1d8e994062bccdf/syct-0.4.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-23 09:33:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nadavo",
    "github_project": "Timer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "syct"
}
        
Elapsed time: 0.33755s