bhargavnova / python-helper-modules

MIT License
7 stars 24 forks source link

Python Script/Function Runtime Calculation Module ⏱️🐍 #21

Closed bhargavnova closed 9 months ago

bhargavnova commented 9 months ago

Objective:

Create a Python module that allows users to calculate the run time of a specific function or an entire script. This module will help users analyze the performance of their code.

Features:

  1. Function Runtime Measurement:

    • Implement functionality to measure the execution time of a specific function.
  2. Script Runtime Measurement:

    • Provide the ability to measure the overall execution time of an entire Python script.
  3. User-Friendly Output:

    • Display the calculated run time in a human-readable format (e.g., seconds, milliseconds, etc.).

Example Usage:

# Example usage of the runtime calculation module
import runtime_calculator

# Measure the runtime of a function
@runtime_calculator.measure_runtime
def my_function():
    # Function code here
    pass

# Call the function
my_function()

# Measure the runtime of the entire script
if __name__ == "__main__":
    runtime_calculator.measure_script_runtime()

Difficulty: Intermediate

Tags: Python, Performance Analysis, Run Time Measurement, Profiling

Additional Information:

Namatuzio commented 9 months ago

Hi, I'll gladly tackle this issue!

bhargavnova commented 9 months ago

Sure!! Just note a few things,

  1. only one pull request per issue is allowed.
  2. add README.md file with documentation.

Thanks : ) Happy Coding!!

bhargavnova commented 9 months ago

Hi @Namatuzio, Fantastic job! Your contribution is invaluable.

I encourage you to continue exploring and contributing to the repo. Your skills and perspective are a valuable addition to this community.

Once again, thank you for your time, effort, and enthusiasm. We look forward to more collaborations in the future!

Warm regards,

Namatuzio commented 9 months ago

Thank you for the opportunity! I had a blast implementing the module!