Custom timer for your Python coding pleasure
Project description
code_timer
Simple python timer to use for single lines of code, or entire functions/classes
New Features!
- codetimer logger allowing you to set the streaming level or hide the logging entirely
- Ability to use
code_timer.Timeras a class, context manager, decorator - Ability to use separate
code_timer.timerdecorator
Basic Usage
You can use code_timer.Timer in several different ways:
-
As a class:
t = Timer(name="class") t.start() # Do something t.stop()
-
As a context manager:
with Timer(name="context manager"): # Do something
-
As a decorator:
@Timer(name="decorator") def stuff(): # Do something
You can also use the function defined decorator code_timer.timer.
-
Without braces
@timer def your_func(): # Do something
-
With braces
@timer(name="my_timer") def your_func(): # Do something
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
code_timer-1.1.1.tar.gz
(4.1 kB
view details)
File details
Details for the file code_timer-1.1.1.tar.gz.
File metadata
- Download URL: code_timer-1.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c60aef111fdfc0f8b41a6c0e62020112aa02466a5d3b129b792f68c4f8d3c338
|
|
| MD5 |
b28a71ce09fb5758d1896650aa3f4659
|
|
| BLAKE2b-256 |
d0bd6f6543d71b5fff245b4f489bc66d17236f5a496279f2b8e9500f223e0082
|