Editing
Sleep
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Approach 2: sleep package of CygWin === Requirement: Install [https://cygwin.com/install.html Cygwin] on {{Win}} & install {{kbd | key=<nowiki>sleep</nowiki>}} package (How-to: [https://x.cygwin.com/docs/ug/setup.html Setting Up Cygwin/X]) Verify the installation of {{kbd | key=<nowiki>sleep</nowiki>}} package<ref>[https://stackoverflow.com/questions/9260014/how-do-i-install-cygwin-components-from-the-command-line How do I install cygwin components from the command line? - Stack Overflow]</ref><ref>[http://polarhome.com/service/man/?qf=SLEEP&af=0&tf=2&of=Cygwin SLEEP man page on Cygwin]</ref> # Key-in {{kbd | key=<nowiki>cmd</nowiki>}} to open command prompt ([https://www.lifewire.com/how-to-open-command-prompt-2618089 How to Open Command Prompt (Windows 10, 8, 7, Vista, XP)]) # Key-in one of following commands #* Key-in {{kbd | key=<nowiki>where sleep</nowiki>}} if you add installation path of CygWin to system path ([[How to setup my system path]]). Or #* Key-in {{kbd | key=<nowiki>dir C:\cygwin64\bin\sleep.exe</nowiki>}} if the installation path of CygWin is {{kbd | key=<nowiki>C:\cygwin64\</nowiki>}}. <pre> C:\Users\user>dir C:\cygwin64\bin\sleep.exe # successful condition C:\cygwin64\bin\sleep.exe # failed condition File Not Found </pre> BAT file: <pre> REM print current date & time ECHO %date% %time% REM sleep 5 ~ 60 seconds SET /a timeout=%RANDOM% * 55 / 32767 + 5 C:\cygwin64\bin\sleep.exe %timeout% REM print current date & time ECHO %date% %time% </pre>
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information