chronowatch


Namechronowatch JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/Ahmad-Said/chrono_stopwatch
SummaryA simple stopwatch for measuring code performance
upload_time2024-10-23 12:46:57
maintainerNone
docs_urlNone
authorAhmad SAID
requires_python>=3.7
licenseMIT
keywords stopwatch profile
VCS
bugtrack_url
requirements typing-extensions
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Stopwatch

A simple stopwatch for measuring code performance.

## Installing

To install the library, you can just run the following command:

```shell
$ python3 -m pip install chronowatch
```

## Examples

```python
from chronowatch import Stopwatch

stopwatch = Stopwatch('Building it')
stopwatch.start("Preparing files")
time.sleep(3.0)
stopwatch.stop()
print(stopwatch.last_task_info())
# TaskInfo(task_name='Preparing files', time_nanos=3009159300)

stopwatch.start("Processing files")
time.sleep(2.0)
stopwatch.stop()

print(stopwatch.pretty_print())
# StopWatch 'Building it': 5.013895300 seconds
# ---------------------------------------------
# Seconds         %         Task name
# ---------------------------------------------
# 3.009159300     60%       Preparing files
# 2.004736000     40%       Processing files

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Ahmad-Said/chrono_stopwatch",
    "name": "chronowatch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "stopwatch, profile",
    "author": "Ahmad SAID",
    "author_email": "hunter.sc.dark@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ad/c0/7e32107009ba70095b6d3322b111a540bc66e3031e718ebc404431c33654/chronowatch-1.0.0.tar.gz",
    "platform": null,
    "description": "# Stopwatch\n\nA simple stopwatch for measuring code performance.\n\n## Installing\n\nTo install the library, you can just run the following command:\n\n```shell\n$ python3 -m pip install chronowatch\n```\n\n## Examples\n\n```python\nfrom chronowatch import Stopwatch\n\nstopwatch = Stopwatch('Building it')\nstopwatch.start(\"Preparing files\")\ntime.sleep(3.0)\nstopwatch.stop()\nprint(stopwatch.last_task_info())\n# TaskInfo(task_name='Preparing files', time_nanos=3009159300)\n\nstopwatch.start(\"Processing files\")\ntime.sleep(2.0)\nstopwatch.stop()\n\nprint(stopwatch.pretty_print())\n# StopWatch 'Building it': 5.013895300 seconds\n# ---------------------------------------------\n# Seconds         %         Task name\n# ---------------------------------------------\n# 3.009159300     60%       Preparing files\n# 2.004736000     40%       Processing files\n\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple stopwatch for measuring code performance",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Ahmad-Said/chrono_stopwatch"
    },
    "split_keywords": [
        "stopwatch",
        " profile"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1301d5985daf829aed5201ad6667d589e0b37167cce6006e9e6188883f90a300",
                "md5": "a99fc0b02527db78cc1d2bfa849ebc74",
                "sha256": "c773843bacc14989fccff204543df41e533f987ad9570993b6c1a2becdc664e8"
            },
            "downloads": -1,
            "filename": "chronowatch-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a99fc0b02527db78cc1d2bfa849ebc74",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3896,
            "upload_time": "2024-10-23T12:46:55",
            "upload_time_iso_8601": "2024-10-23T12:46:55.680649Z",
            "url": "https://files.pythonhosted.org/packages/13/01/d5985daf829aed5201ad6667d589e0b37167cce6006e9e6188883f90a300/chronowatch-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "adc07e32107009ba70095b6d3322b111a540bc66e3031e718ebc404431c33654",
                "md5": "7476e2d0afe7d00c8bd13b1b28414f0b",
                "sha256": "7edab422af1f4208bebc3f2e7193fa8051728759abd66cc34072976c9aca95f3"
            },
            "downloads": -1,
            "filename": "chronowatch-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7476e2d0afe7d00c8bd13b1b28414f0b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3553,
            "upload_time": "2024-10-23T12:46:57",
            "upload_time_iso_8601": "2024-10-23T12:46:57.543086Z",
            "url": "https://files.pythonhosted.org/packages/ad/c0/7e32107009ba70095b6d3322b111a540bc66e3031e718ebc404431c33654/chronowatch-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-23 12:46:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Ahmad-Said",
    "github_project": "chrono_stopwatch",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "typing-extensions",
            "specs": []
        }
    ],
    "lcname": "chronowatch"
}
        
Elapsed time: 9.27971s