cpu-bench: change option
This commit is contained in:
2
cpu-bench/.gitignore
vendored
2
cpu-bench/.gitignore
vendored
@@ -1 +1 @@
|
|||||||
.csv
|
*.csv
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ from tabulate import tabulate
|
|||||||
warnings.filterwarnings("ignore")
|
warnings.filterwarnings("ignore")
|
||||||
R, G, B, W = (f'\x1b[{x}m' for x in (31, 32, 34, 0))
|
R, G, B, W = (f'\x1b[{x}m' for x in (31, 32, 34, 0))
|
||||||
subprocess.run('neofetch')
|
subprocess.run('neofetch')
|
||||||
print(f'{G}$ sysbench cpu --threads=$(nproc) run | grep "events per second"{W}')
|
print(f'{G}$ sysbench cpu --cpu-max-prime=20000 --time=1 --threads=$(nproc) run | grep second{W}')
|
||||||
|
|
||||||
def speed(core):
|
def speed(core):
|
||||||
output = subprocess.run(
|
output = subprocess.run(
|
||||||
f'sysbench cpu --threads={core} run | grep "events per second"',
|
f'sysbench cpu --cpu-max-prime=20000 --time=1 --threads={core} run | grep second',
|
||||||
shell=True, capture_output=True, text=True).stdout.split()[-1]
|
shell=True, capture_output=True, text=True).stdout.split()[-1]
|
||||||
return float(output)
|
return float(output)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user