diff options
| author | bd <bdunahu@operationnull.com> | 2025-07-27 16:00:13 -0600 |
|---|---|---|
| committer | bd <bdunahu@operationnull.com> | 2025-07-27 16:00:13 -0600 |
| commit | 61b9858e52c71f9b04452d09a350e5f3a0d26d28 (patch) | |
| tree | 1d5e6ef0cdb4759e1b3fea56c3f927e8e5d4671a /t/utils.py | |
| parent | 2307761116ce849f45fe92d1e08c647a824a2273 (diff) | |
Partial solution to tracing all lines (coroutines calling methods)
Diffstat (limited to 't/utils.py')
| -rw-r--r-- | t/utils.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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) |
