From 0ed37081d0952ac8654f2f728ae22f1152fc2688 Mon Sep 17 00:00:00 2001 From: Jaewook Lee <11328376+jaewooklee93@users.noreply.github.com> Date: Sat, 17 Aug 2024 23:32:24 +0900 Subject: [PATCH] -m change --- cpu-bench/bench.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpu-bench/bench.py b/cpu-bench/bench.py index d1d9613..8ffa1fd 100755 --- a/cpu-bench/bench.py +++ b/cpu-bench/bench.py @@ -3,10 +3,11 @@ def ensure(*packages): for pkg in packages: try: __import__(pkg) - except: import os; os.sytem(f'pip install -q {pkg}') + except: import os; os.system(f'pip install -q {pkg}') ensure('pandas', 'tabulate') import subprocess, multiprocessing as mp, warnings, pandas as pd +from tqdm.auto import tqdm from tabulate import tabulate warnings.filterwarnings("ignore") R, G, B, W = (f'\x1b[{x}m' for x in (31, 32, 34, 0)) @@ -15,7 +16,8 @@ subprocess.run('neofetch') command = lambda core: f'sysbench cpu --cpu-max-prime=20000 --time=1 --threads={core} run | grep second' -print(f'{G}$ {command("$(nproc)")}{W}') +print(f'{G}$ {command("$(nproc)")}{W}', flush=True) + def speed(core): output = subprocess.run(