mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
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:
parent
b32903d22f
commit
fcfe35c3d8
|
@ -49,4 +49,4 @@ if __name__ == "__main__":
|
|||
unsorted = [int(item) for item in user_input.split(",")]
|
||||
start = time.process_time()
|
||||
print(*bubble_sort(unsorted), sep=",")
|
||||
print(f"Processing time: {time.process_time() - start}")
|
||||
print(f"Processing time: {(time.process_time() - start)%1e9 + 7}")
|
||||
|
|
Loading…
Reference in New Issue
Block a user