Skip to content

Commit

Permalink
Modified args ans kwargs in timer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketchavan2211 committed Mar 5, 2024
1 parent 7a73923 commit 832f872
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
def timer(func):
def wrapper(*args, **kwargs):
start = time.time()
rv = func()
rv = func(*args, **kwargs)
total = time.time() - start
hours, remainder = divmod(total, 3600)
minutes, seconds = divmod(remainder, 60)
milliseconds = int((seconds % 1) * 1000)
microseconds = int((seconds % 1) * 1e6)
nanoseconds = int((seconds % 1) * 1e9)

print(f"Time: {int(hours)} hrs {int(minutes)} min {int(seconds)} sec {milliseconds} ms {microseconds} µs {nanoseconds} ns")
print(f"Time Taken: {int(hours)} hrs {int(minutes)} min {int(seconds)} sec {milliseconds} ms {microseconds} µs {nanoseconds} ns")
return rv
return wrapper

Expand Down

0 comments on commit 832f872

Please sign in to comment.