- #!/bin/bash
- # (bash4 or ksh93)
- #
- # busysleep.sh
- #
- # like POSIX sleep(1), but uses CPU time
- set -o errexit
- typeset -i start_s
- typeset -i sleep_time=$1
- for ((start_s=SECONDS ;
- (SECONDS-start_s) <= sleep_time ;
- )) ; do
- (( 1 ))
- done
- exit 0
busysleep.sh
Posted by Anonymous on Mon 26th Jul 2021 15:08
raw | new post
modification of post by Anonymous (view diff)
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.