Skip to main content

A simple timer module to measure your program's elapsed time.

Project description

total_time Module

The total_time module provides a simple way to measure elapsed time in your Python programs. It includes functions to start a timer, stop it, and calculate the total elapsed time.

Functions

start()

This function initializes the timer by recording the current time. Call this function when you want to start measuring time.

end()

This function stops the timer by recording the current time as the end time. If you haven't called start() before calling end(), this function will not work correctly.

total()

This function calculates and returns the total elapsed time in seconds from when start() was called to when end() was called.

  • If end() has not been called yet, it will automatically call end() before calculating the total time.

ttotal()

This function prints a message indicating how long the operation took. The message will state: total = total elapsed time in seconds from when start() was called to when end() was called "It took the computer {total} seconds."

  • If you have not called end() before using this function, it will automatically call end() first to ensure accurate timing.

Usage Example

Here’s a quick example of how to use the total_time module:

import total_time

start()
# ... your code here ...
end()
ttotal()

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

total_time-0.0.5.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

total_time-0.0.5-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file total_time-0.0.5.tar.gz.

File metadata

  • Download URL: total_time-0.0.5.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for total_time-0.0.5.tar.gz
Algorithm Hash digest
SHA256 6b6acfe2c58a5e4fc4cb3a506a36f2aa00b4083438f3b84a8f9cee4a45958dad
MD5 9a34c2004a95fb9a7865a341ed08f486
BLAKE2b-256 1ec373658c2beaccab47e424f8ca98bf904e2957b64e08189b1703e92d83bcc2

See more details on using hashes here.

File details

Details for the file total_time-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: total_time-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for total_time-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 78e751cc1ce34094bf8a55cf7155feb20f3007c75c3f60e24707691f123a38ab
MD5 8a65cfc79de97c1a16c8cb5dc967b716
BLAKE2b-256 655131d0ebd23121ff0639b7892c1c771d1d6380dfad40c925f078964f32b11e

See more details on using hashes here.

Supported by

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