For the better understanding of time taken. (#6583)

* For the better understanding of time taken.

In this change I have initialized a variable p with the value of (1e9+7) and then took the modulus of process time with it . This modification gives better time taken by the process . Firstly it was giving answer in the exponential now it gives in the integer form.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
This commit is contained in:
samyakpagariya 2022-10-30 16:13:41 +05:30 committed by GitHub
parent b32903d22f
commit fcfe35c3d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,4 +49,4 @@ if __name__ == "__main__":
unsorted = [int(item) for item in user_input.split(",")] unsorted = [int(item) for item in user_input.split(",")]
start = time.process_time() start = time.process_time()
print(*bubble_sort(unsorted), sep=",") print(*bubble_sort(unsorted), sep=",")
print(f"Processing time: {time.process_time() - start}") print(f"Processing time: {(time.process_time() - start)%1e9 + 7}")