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.4.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.4-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: total_time-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 7d522b3252ce88029a0058a2aa3f2a69e424c42dcd9926d463787cc72a621a40
MD5 3dc3aa92f13d53c273510d638f4a2dc6
BLAKE2b-256 80e74bfb5a91d912142f5e94ebc8df7dba4bada80b82f3a414a6471cd714d709

See more details on using hashes here.

File details

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

File metadata

  • Download URL: total_time-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 887c1721aeb75d426026b69b4a703f40aa47d400ecfef07f8daf557b241be967
MD5 91151cb79920198aa0ce7d0e29a15aeb
BLAKE2b-256 30a90bec656f1653fb32b1aa2814f48e1be7225f7444539b6a011bc858bb6ba8

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