From c0911004a761252dbf683328dc5fb3b214fb5248 Mon Sep 17 00:00:00 2001 From: persi Date: Fri, 21 Dec 2018 23:14:58 +0500 Subject: [PATCH] fix max_iter calc when float is given --- memory_profiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory_profiler.py b/memory_profiler.py index e03b313..20e3c11 100644 --- a/memory_profiler.py +++ b/memory_profiler.py @@ -301,7 +301,7 @@ def memory_usage(proc=-1, interval=.1, timeout=None, timestamps=False, ret = -1 if timeout is not None: - max_iter = int(timeout / interval) + max_iter = int(round(timeout / interval)) elif isinstance(proc, int): # external process and no timeout max_iter = 1