Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 38

Thread: Программеры быстрый вопрос к вам

  1. #11
    Кассандр peterburger's Avatar
    Join Date
    Dec 2006
    Location
    LA
    Posts
    34,972

    Default Re: Программеры быстрый вопрос к вам

    Quote Originally Posted by бубенчиков
    Трик

    ping -n <number> localhost
    e.g. ping -n 30 localhost

    будет пинговать 30 секунд
    потом закончит
    cute
    "... Настоящая женщина - это та, которая не прошлая и не будущая..."фтык:мой музон мысли fotki
    © Copyright Peterburger 1998-2018, All rights and lefts are reserved.

  2. #12
    Патриот смешно's Avatar
    Join Date
    Apr 2003
    Location
    Страна чудес
    Posts
    55,561

    Default Re: Программеры быстрый вопрос к вам

    Quote Originally Posted by химик
    Ответ не правильный
    [Windows 2003 OS] в батч файле не понимает команду [sleep]
    скажу более даже команда
    [idletimer] внутри батч файла на исполнима
    Учись, студент.

    Putting those batch commands to sleep...


    Funny ... just when you think the whole world knows about some thing, you find out that ain't always the case.
    Someone asked recently how to create a delay between executing two separate commands in a batch file. The answer (of course) is to use the 'sleep.exe' utility. But in Microsoft's infinite wisdom, they don't just give it to you ... you've got to download it, and install it. And then remember to install it on every workstation that may need torun the batch script you're creating.
    Sleep.exe is included in the free Windows 2003 Resource Kit, which you can download from here:
    http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
    Last edited by смешно; 03-12-2008 at 02:05 PM.
    4 main reasons why Boston is the best place to live:Red Sox (Baseball), Patriots (Football) World Champions
    Celtics the NBA (Basketball), Bruins Stanley Cup (Hockey)

  3. #13
    Патриот смешно's Avatar
    Join Date
    Apr 2003
    Location
    Страна чудес
    Posts
    55,561

    Default Re: Программеры быстрый вопрос к вам

    Quote Originally Posted by crazy-mike
    Если доставить Microsoft SFU - то очень даже хорошо будет всё "понимать". :grum:
    Помню в былые далёкие времена делали LOOPS в программах, для пауз....:grum: Представляю сколько надо таких циклов для современных CPU....:grum:

    типо

    FOR i=1 to 10000000

    i=i+1

    NEXT
    4 main reasons why Boston is the best place to live:Red Sox (Baseball), Patriots (Football) World Champions
    Celtics the NBA (Basketball), Bruins Stanley Cup (Hockey)

  4. #14
    Forum Hero Alex_3112's Avatar
    Join Date
    Jul 2005
    Location
    Туц Оукыун
    Posts
    12,761

    Default Re: Программеры быстрый вопрос к вам

    Quote Originally Posted by смешно
    Помню в былые далёкие времена делали LOOPS в программах, для пауз....:grum: Представляю сколько надо таких циклов для современных CPU....:grum:

    типо

    FOR i=1 to 10000000

    i=i+1

    NEXT
    Современный CPU такой цикл может запросто оптимизировать

  5. #15
    Казак я, мать вашу! химик's Avatar
    Join Date
    Aug 2004
    Location
    USA, Fredneck, MD
    Posts
    41,918

    Default Re: Программеры быстрый вопрос к вам

    Шутка с пингом работает хорошо кстати
    но не ужели нету никакой команды что бы просто внутри стрипта поставить паузу на 120 секунд??? А потом не хочу я ничего на этот сервак сверх того что на нём есть инсталировать
    Ничто не сближает людей так, как общее одеяло :kos:

  6. #16
    подниматель пингвинов crazy-mike's Avatar
    Join Date
    Nov 2006
    Location
    L'viv
    Posts
    179,963

    Default Re: Программеры быстрый вопрос к вам

    Quote Originally Posted by смешно
    Помню в былые далёкие времена делали LOOPS в программах, для пауз....:grum: Представляю сколько надо таких циклов для современных CPU....:grum:

    типо

    FOR i=1 to 10000000

    i=i+1

    NEXT
    SIN(TIME) ==== прикольнее... :grum:

  7. #17
    красный wlass's Avatar
    Join Date
    Sep 2007
    Posts
    17,958

    Default Re: Программеры быстрый вопрос к вам

    Quote Originally Posted by химик
    Шутка с пингом работает хорошо кстати
    но не ужели нету никакой команды что бы просто внутри стрипта поставить паузу на 120 секунд??? А потом не хочу я ничего на этот сервак сверх того что на нём есть инсталировать
    Года 4 назад пришлось мне даже сочинять такую программульку - не мог ничего подходящего найти. Тоже понадобилась пауза в скрипте. А про пинг не догадался вовремя А чем собственно плох пинг? Все равно процессору придется отвлекаться на нее, хоть пинг, хоть др. команда с отсчетом времени.

  8. #18
    подниматель пингвинов crazy-mike's Avatar
    Join Date
    Nov 2006
    Location
    L'viv
    Posts
    179,963

    Default Re: Программеры быстрый вопрос к вам

    http://malektips.com/xp_dos_0002.html
    Batch file SLEEP Command

    SUMMARY: Cause Windows XP batch files to sleep for a given number of seconds.

    Most operating systems provide a command in batch files to sleep, or wait, a certain number of seconds. This is great in that batch files can display text, allowing you time to read before continuing. Or, batch files may wait a few seconds in order to connect to other resources.

    While Windows XP does not come with such a command, there are tricks to emulate it, such as a 'ping' command trick to emulate the sleep command. However, if you wish, the Windows 2003 Resource Kit provides a 'sleep' command requiring no extra tricks. The Resource Kit is a large download, but besides the 'sleep' command, the Windows 2003 Resource Kit also provides tools to remap keys, query the Active Directory, display the last 'n' lines of a text file (a tail command), and more. To download and install the Resource Kit:

    1. Go to the Microsoft Windows Server 2003 download section at http://www.microsoft.com/windowsserver2003/
    downloads/tools/default.mspx. Or, if that link does not work, visit http://www.microsoft.com/ and search for "Windows 2003". Once there, choose the "Downloads -> Tools" link.

    2. Select the link "Windows Server 2003 Resource Kit Tools".

    3. Click the "Download" link. Choose to register or not, depending on your choice, and follow the on-screen instructions to download and install the product. The default install directory is "C:\Program Files\Windows Resource Kits\Tools\".

    Once the Windows 2003 Resource Kit is installed, you may need to reboot your machine for the directory "C:\Program Files\Windows Resource Kits\Tools\" to be added to your path.

    Now that the sleep command is available, to see the online help, enter the following DOS command:

    C:\>sleep /?

    Or, just issue the command:

    C:\>sleep N

    Replace N with the number of seconds for batch file to 'sleep'. For example, a batch file can wait 5 seconds before continuing by issuing this command:

    C:\>sleep 5

    If you need to wait just a few milliseconds, issue this command:

    C:\>sleep -m N

    So, to sleep half a second:

    C:\>sleep -m 500

    Although this command supports a 'precise' millisecond sleep, I would not recommend it for real-time processing!

    Насколько я понял - надо go sleep вовремя делать , а не торчать за компом до четырёх утра. :grum:

  9. #19
    Forum Hero Alex_3112's Avatar
    Join Date
    Jul 2005
    Location
    Туц Оукыун
    Posts
    12,761

    Default Re: Программеры быстрый вопрос к вам

    Quote Originally Posted by wlass
    А чем собственно плох пинг?
    Плох тем, что этот скрипт будут видеть другие люди, и возможно смеяться

  10. #20
    подниматель пингвинов crazy-mike's Avatar
    Join Date
    Nov 2006
    Location
    L'viv
    Posts
    179,963

    Default Re: Программеры быстрый вопрос к вам

    Quote Originally Posted by Alex_3112
    Плох тем, что этот скрипт будут видеть другие люди, и возможно смеяться
    При программировании под Win32 API чувство юмора куда-то прячется...:grum:

Page 2 of 4 FirstFirst 1234 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Russian America Top. Рейтинг ресурсов Русской Америки. Terms of Service | Privacy Policy Рейтинг@Mail.ru