(change version)

a small issue fix, where cpu spike caused by inxi itself gives a bad cpu speed. Solution, put a 0.3 sleep time right before we get the cpu 
data.

Less than 0.3 wasn't s reliable, not sure how much time the kernel needs to slow down cpus again.

user can set config override of this time easily.

Maybe one day inxi will be released with config files in /etc, then this stuff can be documented better in the file.

I found the sleep largely unnoticeable in my tests.
This commit is contained in:
inxi-svn 2010-02-15 05:05:47 +00:00
parent 987eb7abe7
commit dc4ed951b1

6
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.4.3 #### version: 1.4.4
#### Date: February 14 2010 #### Date: February 14 2010
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -168,6 +168,8 @@ LANG=C
CMDL_MAX='' CMDL_MAX=''
COLOR_SCHEME='' COLOR_SCHEME=''
COLOR_SCHEME_SET='' COLOR_SCHEME_SET=''
# override in user config if desired, seems like less than .3 doesn't work as reliably
CPU_SLEEP='0.3'
IRC_CLIENT='' IRC_CLIENT=''
IRC_CLIENT_VERSION='' IRC_CLIENT_VERSION=''
PS_COUNT=5 PS_COUNT=5
@ -1914,6 +1916,8 @@ get_cpu_data()
local i='' j='' cpu_array_nu='' a_cpu_working='' multi_cpu='' bits='' local i='' j='' cpu_array_nu='' a_cpu_working='' multi_cpu='' bits=''
if [[ $B_CPUINFO_FILE == 'true' ]];then if [[ $B_CPUINFO_FILE == 'true' ]];then
# stop script for a bit to let cpu slow down before parsing cpu /proc file
sleep $CPU_SLEEP
IFS=$'\n' IFS=$'\n'
A_CPU_DATA=( $( gawk -F': ' ' A_CPU_DATA=( $( gawk -F': ' '
BEGIN { BEGIN {