pastebin - collaborative debugging tool
rovema.kpaste.net RSS


busysleep.sh
Posted by Anonymous on Mon 26th Jul 2021 15:05
raw | new post
view followups (newest first): busysleep.sh by Anonymous

  1. #
  2. # busysleep.sh
  3. #
  4. # like POSIX sleep(1), but uses CPU time
  5.  
  6. set -o errexit
  7.  
  8. typeset -i start_s
  9. typeset -i sleep_time=$1
  10.  
  11. for ((start_s=SECONDS ;
  12.         (SECONDS-start_s) < sleep_time ;
  13.         )) ; do
  14.         (( 1 ))
  15. done
  16.  
  17. exit 0

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at