From 61b9858e52c71f9b04452d09a350e5f3a0d26d28 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 27 Jul 2025 16:00:13 -0600 Subject: Partial solution to tracing all lines (coroutines calling methods) --- t/utils.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 't/utils.py') diff --git a/t/utils.py b/t/utils.py index 4dde466..ee9478d 100644 --- a/t/utils.py +++ b/t/utils.py @@ -1,5 +1,6 @@ from aergia.aergia import Aergia import yappi +import time import unittest @@ -63,3 +64,16 @@ class AergiaUnitTestCase(unittest.TestCase): for s in stats: if s.name == func_name: return s.ttot + + +def burn_cpu(sec): + t0 = Aergia._gettime() + elapsed = 0 + while (elapsed < sec): + for _ in range(1000): + pass + elapsed = Aergia._gettime() - t0 + + +def burn_io(sec): + time.sleep(sec) -- cgit v1.2.3