Timer Score is a timing library that provides a score from 0 to 1 for performance
Project description
Timer Score
Timer Score is a timer library that provides a score from 0 to 1 for how well the timed code meets the expected target duration. The main driver for this library is the fact that most measurements of LLMs return a score from 0 to 1 (i.e. BLEU, ROUGE, etc). The Timer Score library enables you to similarly produce a score from 0 to 1 for performance.
Features
timer - Track time in milliseconds for any code or function
scoring - Calculate a score from 0 to 1 based on performance against a target duration
checkpoints - Capture multiple checkpoints during timing including individual targets for each checkpoint
timed functions - Time an entire function or method with a single call
reset - Reset the timer for multiple tests of the same code
sleep - Sleep the timer to allow for parallel code execution
Documentation
Installation
First install the timer_score library.
pip install timer-score
Instantiate the timer with your target duration. Use timer.stop() when the task is complete and timer.score() to get the final score.
from timer_score import TSTimer
timer = TSTimer(2)
# The code you are timing goes here
timer.stop()
score, duration, target = timer.score()
# 0.53... 1.85... 2
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timer_score-0.1.3.tar.gz.
File metadata
- Download URL: timer_score-0.1.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c16f3797c3fb07d8e93931a6c86bef7e1ac8bc95eb6e63221250444d1802d4f3
|
|
| MD5 |
d12b815308bdb59e5912ef2c482c85c8
|
|
| BLAKE2b-256 |
d4d2abedc089979d0a6e314d87a13ad8da2e20376ffc7329b4c5137eec10fd24
|
File details
Details for the file timer_score-0.1.3-py3-none-any.whl.
File metadata
- Download URL: timer_score-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f19b7770450d60051839fe472ac3b4d7e187e9c0c30639ecc4fd48acc07c3cc2
|
|
| MD5 |
80e97b3d02ccdcb5da30dba0b51b9788
|
|
| BLAKE2b-256 |
71481633107e7396b05b4df7db86ee81996cabe2b8ed700639d6c65653067060
|