Jump to content

Command Line Sleep


Recommended Posts

Here is a python version of sleep just convert to you OS enjoy! Also please comment on errors or features you want.


import time
import sys
for i in sys.argv:
    if i == '-m':
    if i == '-min':
    if i == '-hour':
if t=='hour':
if t=='m':
if t=='min':
    print 'An Unknown Error Ocurred. Press Enter to Exit'
    raw_input(' ')

Link to comment
Share on other sites

Is time.sleep(1) on windows the same as time.sleep(1) on linux?

Basically this is a python script to have a sleep command on windows and mac ox x, both I believe don't have a command except if ping to >nul (clumsy). the time.sleep(1) is python module time and the command sleep sleeping for 1 second. This script excepts -m for milliseconds -s for seconds (defaults to that) -min for minutes and -hour for hours. It then scans the arguments and parses them if there is a problem it quits with 1 as a return value (saying it failed) and saying something went wrong.

Link to comment
Share on other sites

C++ Sleep command, made it for my NintendoDS as DevKitARM dont have a sleep command.

void sleep(int secs) {
   int start = time(NULL);
   while ((time(NULL) - start) < secs) {

Delphi port

procedure sleep(secs:integer);
  while (time(nil) - start) < secs) do
        //DO NOTHING!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...