Replace time.time() to time.perf_counter() for benchmarking. (#6178)
Signed-off-by: Lifu Huang <lifu.hlf@gmail.com>
This commit is contained in:
@@ -42,10 +42,10 @@ class TestReleaseMemoryOccupation(CustomTestCase):
|
||||
)
|
||||
|
||||
print("release_memory_occupation start")
|
||||
t = time.time()
|
||||
t = time.perf_counter()
|
||||
engine.release_memory_occupation()
|
||||
if _DEBUG_EXTRA:
|
||||
print("release_memory_occupation", time.time() - t)
|
||||
print("release_memory_occupation", time.perf_counter() - t)
|
||||
|
||||
if _DEBUG_EXTRA:
|
||||
time.sleep(5)
|
||||
@@ -60,10 +60,10 @@ class TestReleaseMemoryOccupation(CustomTestCase):
|
||||
time.sleep(5)
|
||||
|
||||
print("resume_memory_occupation start")
|
||||
t = time.time()
|
||||
t = time.perf_counter()
|
||||
engine.resume_memory_occupation()
|
||||
if _DEBUG_EXTRA:
|
||||
print("resume_memory_occupation", time.time() - t)
|
||||
print("resume_memory_occupation", time.perf_counter() - t)
|
||||
|
||||
self.assertEqual(
|
||||
_try_allocate_big_tensor(),
|
||||
|
||||
Reference in New Issue
Block a user