diff --git a/cpu-bench/.gitignore b/cpu-bench/.gitignore index df68529..df2929e 100644 --- a/cpu-bench/.gitignore +++ b/cpu-bench/.gitignore @@ -1 +1 @@ -bench.csv +.csv diff --git a/cpu-bench/bench.py b/cpu-bench/bench.py index df9d097..14df329 100755 --- a/cpu-bench/bench.py +++ b/cpu-bench/bench.py @@ -5,7 +5,7 @@ from tabulate import tabulate warnings.filterwarnings("ignore") R, G, B, W = (f'\x1b[{x}m' for x in (31, 32, 34, 0)) subprocess.run('neofetch') -print(f'{R}$ sysbench cpu --threads={core} run | grep "events per second"{W}' +print(f'{G}$ sysbench cpu --threads=$(nproc) run | grep "events per second"{W}') def speed(core): output = subprocess.run( @@ -23,7 +23,7 @@ for core in range(1, mp.cpu_count()+1): } df.append(row) df = pd.DataFrame(df) -df.to_csv('bench.csv', index=False) +df.to_csv('result.csv', index=False) df.iloc[:, 0] = df.iloc[:, 0].apply(lambda s: f'{R}{s}{W}') df.iloc[:, 1] = df.iloc[:, 1].apply(lambda s: f'{G}{int(s)}{W}')