Skip to content

Commit cedd238

Browse files
authored
Merge pull request #222 from perminovs/fix-float-round
fix max_iter calc when float is given
2 parents 8194a59 + c091100 commit cedd238

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

memory_profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def memory_usage(proc=-1, interval=.1, timeout=None, timestamps=False,
301301
ret = -1
302302

303303
if timeout is not None:
304-
max_iter = int(timeout / interval)
304+
max_iter = int(round(timeout / interval))
305305
elif isinstance(proc, int):
306306
# external process and no timeout
307307
max_iter = 1

0 commit comments

Comments
 (0)