Skip to content
Permalink
Browse files

@dankogai /proc/uptime is not portable so replaced with perl's Time::…

…HiRes
  • Loading branch information...
dankogai committed Dec 7, 2011
1 parent 740fb75 commit 56f6bbe758f8af465d6bd389e8ddc7ed8e1f24da
Showing with 4 additions and 16 deletions.
  1. +4 −16 shell/cat.sh
@@ -10,6 +10,9 @@
#
# @see http://kenji1234.blog75.fc2.com/blog-entry-19.html
#
#
# @dankogai /proc/uptime is not portable so replaced with perl's Time::HiRes
#

concatable () {
local MIN_FILE_COUNT=2
@@ -62,23 +65,8 @@ CAT_2[7]="(⌒) (⌒) ::::::::: /"
CAT_2[8]=" ;, :' ; : : ::::::::`:、"
CAT_2[9]=" ; ,:' ';,. : : ::::::`:、"

START=0
set_START () {
END=0
ELAPS=0
local dummy
read START dummy < /proc/uptime
}
set_ELAPS () {
local dummy
read END dummy < /proc/uptime
ELAPS=$(( ${END/./}0-${START/./}0 ))
}
mili_sleep () {
set_START
while (( ELAPS <= $1 )); do
set_ELAPS
done
perl -MTime::HiRes=sleep -e sleep -e 0.05
}

clr() {

0 comments on commit 56f6bbe

Please sign in to comment.
You can’t perform that action at this time.