mirror of
https://github.com/teddysun/across.git
synced 2025-01-31 12:19:35 +08:00
Update bench.sh
This commit is contained in:
parent
d7b431f32a
commit
70d1d224fc
8
bench.sh
8
bench.sh
@ -220,7 +220,7 @@ print_intro() {
|
|||||||
# Get System information
|
# Get System information
|
||||||
get_system_info() {
|
get_system_info() {
|
||||||
cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' )
|
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 )
|
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]*$//' )
|
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}' )
|
tram=$( LANG=C; free -m | awk '/Mem/ {print $2}' )
|
||||||
@ -249,7 +249,11 @@ get_system_info() {
|
|||||||
}
|
}
|
||||||
# Print System information
|
# Print System information
|
||||||
print_system_info() {
|
print_system_info() {
|
||||||
echo " CPU Model : $(_blue "$cname")"
|
if [ -n "$cname" ]; then
|
||||||
|
echo " CPU Model : $(_blue "$cname")"
|
||||||
|
else
|
||||||
|
echo " CPU Model : $(_blue "CPU model not detected")"
|
||||||
|
fi
|
||||||
echo " CPU Cores : $(_blue "$cores")"
|
echo " CPU Cores : $(_blue "$cores")"
|
||||||
if [ -n "$freq" ]; then
|
if [ -n "$freq" ]; then
|
||||||
echo " CPU Frequency : $(_blue "$freq MHz")"
|
echo " CPU Frequency : $(_blue "$freq MHz")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user