Update bench.sh

This commit is contained in:
Teddysun 2022-01-02 21:44:51 +09:00
parent d7b431f32a
commit 70d1d224fc
No known key found for this signature in database
GPG Key ID: 09BD4C080AD6C46D

View File

@ -220,7 +220,7 @@ print_intro() {
# Get System information
get_system_info() {
cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' )
cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
cores=$( awk -F: '/processor/ {core++} END {print core}' /proc/cpuinfo )
freq=$( awk -F'[ :]' '/cpu MHz/ {print $4;exit}' /proc/cpuinfo )
ccache=$( awk -F: '/cache size/ {cache=$2} END {print cache}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' )
tram=$( LANG=C; free -m | awk '/Mem/ {print $2}' )
@ -249,7 +249,11 @@ get_system_info() {
}
# Print System information
print_system_info() {
if [ -n "$cname" ]; then
echo " CPU Model : $(_blue "$cname")"
else
echo " CPU Model : $(_blue "CPU model not detected")"
fi
echo " CPU Cores : $(_blue "$cores")"
if [ -n "$freq" ]; then
echo " CPU Frequency : $(_blue "$freq MHz")"