Skip to main content

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

Documentation on github

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timer_score-0.1.3.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

timer_score-0.1.3-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page