GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kephircheek/python-timeti: Serialize elapsed time of functions, loops and code blocks

BranchesTags
Open more actions menu

Latest commit

 

History

33 Commits
33 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
examples
examples
 
 
tests
tests
 
 
timeti
timeti
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

timeti

Serialize elapsed time of functions, loops and code blocks.

test PyPI version license: MIT code style: black

Experience

Install

pip install timeti

Usage

  • Profile function with decorator

    >>> @timeti.profiler
    ... def ultimative_question(*args, **kwargs):
    ...     sum(range(100_000))
    ... 
    >>> ultimative_question()
    Elapsed time of 'ultimative_question' function: 4 ms
  • Profile loop with wrap

    >>> for i in timeti.profiler(range(2)):
    ...     _ = sum(range(100_000))
    ... 
    Elapsed time of loop iteration 0: 4 ms
    Elapsed time of loop iteration 1: 3 ms
    Elapsed time of loop: 8 ms
  • Profile code blocks with context manager

    >>> with timeti.profiler():
    ...     _ = sum(range(100_000))
    ... 
    Elapsed time of block: 5 ms

Development

Install

pip install -e ".[dev]"

Run linters

  • Format Python code with black

    python -m black .
    
  • Check types with mypy

    python -m mypy .
    
  • Sort imports alphabetically with isort

    python -m isort .
    
  • Analyze Python docstring with pydocstyle

    python -m pydocstyle .
    

Run tests

  • Run tests

    python -m unittest discover -s tests  
    
  • Run doctests for clock face

    python -m doctest -v timeti/clockface.py  
    

About

Serialize elapsed time of functions, loops and code blocks

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.