1. sleep( ) in DOS32
- Posted by Rubens Monteiro Luciano <rml at rubis.trix.net> Nov 24, 2004
- 621 views
- Last edited Nov 25, 2004
Hi, How do I sleep less than 1 second in DOS32 ? Is there anyway to simulate a sleep of 500 miliseconds, for example ? The system must stay free during this time. Maybe it=B4s time to have a sleep_miliseconds( ) function... Rubens
2. Re: sleep( ) in DOS32
- Posted by "Kat" <gertie at visionsix.com> Nov 24, 2004
- 586 views
- Last edited Nov 25, 2004
On 24 Nov 2004, at 17:17, Rubens Monteiro Luciano wrote: > > > Hi, > > How do I sleep less than 1 second in DOS32 ? > Is there anyway to simulate a sleep of 500 miliseconds, for example ? > The system must stay free during this time. > Maybe it=B4s time to have a sleep_miliseconds( ) function... Since dos is neither re-entrant nor multitasking, what is it to stay free for? On Wed, 17 Nov 2004 16:09:25 -0800, rudy toews <guest at rapideuphoria.com> wrote: > Re: Eu locking harddrives <http://statik.topica.com/lists/read/images/icon_pencil.gif> > BTW: How > about allowing any atom as argument for sleep(), not only an integer? I just got an error message from Eu, > because I tried to call sleep(0.5). > > --for .exw (WinDoze) > include dll.e > include misc.e --for old sleep() > constant > k32=open_dll("kernel32"), > zSleep=define_c_proc(k32,"Sleep",{C_UINT}) > --usage: > --c_proc(zSleep,{x}) > --where x is in MILLISECONDS! --Zero allowed > --demo is: > printf(1,"%s\n",{"Start"}) > c_proc(zSleep,{3500}) > printf(1,"%s\n",{"3.5 seconds later..."}) > sleep(2) -- ;) > > Nice, thank you. > > Regards, > Juergen > http://www.ListFilter.com/cgi- bin/esearch.exu?fromMonth=A&fromYear=9&toMonth=A&toYear=9&postedB y=otterdad&keywords=sleep > Yours, OtterDad Kat
3. Re: sleep( ) in DOS32
- Posted by Rubens Monteiro Luciano <rml at rubis.trix.net> Nov 24, 2004
- 582 views
- Last edited Nov 25, 2004
Thanks Kat, I didn=B4t find this in a quick search in the euforum. This solve the problem. What I mean with "stay free" is to not use 100% of the processor like for i=1 to 1000000 do blablabla end for Rubens At 18:24 24/11/2004, you wrote: > > >On 24 Nov 2004, at 17:17, Rubens Monteiro Luciano wrote: > > > > > Hi, > > > > How do I sleep less than 1 second in DOS32 ? > > Is there anyway to simulate a sleep of 500 miliseconds, for example ? > > The system must stay free during this time. > > Maybe it=B4s time to have a sleep_miliseconds( ) function... > >Since dos is neither re-entrant nor multitasking, what is it to stay free = for? > >On Wed, 17 Nov 2004 16:09:25 -0800, rudy toews ><guest at rapideuphoria.com> wrote: > > Re: Eu locking harddrives ><http://statik.topica.com/lists/read/images/icon_pencil.gif> > BTW: How= > > about allowing any atom as argument for sleep(), not only an integer? I= > just >got an error message from Eu, > > because I tried to call sleep(0.5). > > > > --for .exw (WinDoze) > > include dll.e > > include misc.e --for old sleep() > > constant > > k32=open_dll("kernel32"), > > zSleep=define_c_proc(k32,"Sleep",{C_UINT}) > > --usage: > > --c_proc(zSleep,{x}) > > --where x is in MILLISECONDS! --Zero allowed > > --demo is: > > printf(1,"%s\n",{"Start"}) > > c_proc(zSleep,{3500}) > > printf(1,"%s\n",{"3.5 seconds later..."}) > > sleep(2) -- ;) > > > > Nice, thank you. > > > > Regards, > > Juergen > > > http://www.ListFilter.com/cgi- >bin/esearch.exu?fromMonth=A&fromYear=9&toMonth=A&toYear=9&postedB >y=otterdad&keywords=sleep > > > Yours, OtterDad > >Kat > > >
4. Re: sleep( ) in DOS32
- Posted by CoJaBo <CoJaBo_EUforum_Address at CJBN.net> Nov 25, 2004
- 620 views
Rubens Monteiro Luciano wrote: > > Thanks Kat, > > I didn=B4t find this in a quick search in the euforum. > This solve the problem. > What I mean with "stay free" is to not use 100% of the processor A translation of what Kat said: DOS doesn't support that. You can use a while loop and time() to get partial-second sleep time. If you are running a dos window under windows, the only way to accomplish that is to use windosw. > like > for i=1 to 1000000 do > blablabla > end for > > Rubens > > At 18:24 24/11/2004, you wrote: > > > > > >On 24 Nov 2004, at 17:17, Rubens Monteiro Luciano wrote: > > > > > > > > Hi, > > > > > > How do I sleep less than 1 second in DOS32 ? > > > Is there anyway to simulate a sleep of 500 miliseconds, for example ? > > > The system must stay free during this time. > > > Maybe it=B4s time to have a sleep_miliseconds( ) function... > > > >Since dos is neither re-entrant nor multitasking, what is it to stay free = > for? > > > >On Wed, 17 Nov 2004 16:09:25 -0800, rudy toews > ><guest at rapideuphoria.com> wrote: > > > Re: Eu locking harddrives > ><<a > >href="http://statik.topica.com/lists/read/images/icon_pencil.gif">http://statik.topica.com/lists/read/images/icon_pencil.gif</a>> > > > BTW: How= > > > > about allowing any atom as argument for sleep(), not only an integer? I= > > > just > >got an error message from Eu, > > > because I tried to call sleep(0.5). > > > > > > --for .exw (WinDoze) > > > include dll.e > > > include misc.e --for old sleep() > > > constant > > > k32=open_dll("kernel32"), > > > zSleep=define_c_proc(k32,"Sleep",{C_UINT}) > > > --usage: > > > --c_proc(zSleep,{x}) > > > --where x is in MILLISECONDS! --Zero allowed > > > --demo is: > > > printf(1,"%s\n",{"Start"}) > > > c_proc(zSleep,{3500}) > > > printf(1,"%s\n",{"3.5 seconds later..."}) > > > sleep(2) -- ;) > > > > > > Nice, thank you. > > > > > > Regards, > > > Juergen > > > > > <a > > > href="http://www.ListFilter.com/cgi-">http://www.ListFilter.com/cgi-</a> > >bin/esearch.exu?fromMonth=A&fromYear=9&toMonth=A&toYear=9&postedB > >y=otterdad&keywords=sleep > > > > > Yours, OtterDad > > > >Kat > > > >
5. Re: sleep( ) in DOS32
- Posted by Rubens Monteiro Luciano <rml at rubis.trix.net> Nov 25, 2004
- 607 views
Hi CojaBo, sleep() works under a dos window. No problem. I just need less than 1 second delays. All it=B4s ok now. Thanks. Rubens At 22:53 24/11/2004, you wrote: > > >posted by: CoJaBo <CoJaBo_EUforum_Address at CJBN.net> > >Rubens Monteiro Luciano wrote: > > > > Thanks Kat, > > > > I didn=B4t find this in a quick search in the euforum. > > This solve the problem. > > What I mean with "stay free" is to not use 100% of the processor >A translation of what Kat said: >DOS doesn't support that. > >You can use a while loop and time() to get >partial-second sleep time. >If you are running a dos window under >windows, the only way to accomplish >that is to use windosw. > > > like > > for i=1 to 1000000 do > > blablabla > > end for > > > > Rubens > > > > At 18:24 24/11/2004, you wrote: > > > > > > > > >On 24 Nov 2004, at 17:17, Rubens Monteiro Luciano wrote: > > > > > > > > > > > Hi, > > > > > > > > How do I sleep less than 1 second in DOS32 ? > > > > Is there anyway to simulate a sleep of 500 miliseconds, for exampl= e ? > > > > The system must stay free during this time. > > > > Maybe it=B4s time to have a sleep_miliseconds( ) function... > > > > > >Since dos is neither re-entrant nor multitasking, what is it to stay= > free = > > for? > > > > > >On Wed, 17 Nov 2004 16:09:25 -0800, rudy toews > > ><guest at rapideuphoria.com> wrote: > > > > Re: Eu locking harddrives > > ><<a=20 > href="http://statik.topica.com/lists/read/images/icon_pencil.gif">http:= //statik.topica.com/lists/read/images/icon_pencil.gif</a>> > > BTW: How= > > > > > > about allowing any atom as argument for sleep(), not only an > integer? I= > > > > > just > > >got an error message from Eu, > > > > because I tried to call sleep(0.5). > > > > > > > > --for .exw (WinDoze) > > > > include dll.e > > > > include misc.e --for old sleep() > > > > constant > > > > k32=open_dll("kernel32"), > > > > zSleep=define_c_proc(k32,"Sleep",{C_UINT}) > > > > --usage: > > > > --c_proc(zSleep,{x}) > > > > --where x is in MILLISECONDS! --Zero allowed > > > > --demo is: > > > > printf(1,"%s\n",{"Start"}) > > > > c_proc(zSleep,{3500}) > > > > printf(1,"%s\n",{"3.5 seconds later..."}) > > > > sleep(2) -- ;) > > > > > > > > Nice, thank you. > > > > > > > > Regards, > > > > Juergen > > > > > > > <a=20 > href="http://www.ListFilter.com/cgi-">http://www.ListFilter.com/cgi-</a= > > > >bin/esearch.exu?fromMonth=A&fromYear=9&toMonth=A&toYear=9&post= edB > > >y=otterdad&keywords=sleep > > > > > > > Yours, OtterDad > > > > > >Kat > > > > > > > >
6. Re: sleep( ) in DOS32
- Posted by "Igor Kachan" <kinz at peterlink.ru> Nov 25, 2004
- 581 views
Rubens Monteiro Luciano wrote: > > > > Hi, > > > > How do I sleep less than 1 second in DOS32 ? > > Is there anyway to simulate a sleep of 500 miliseconds, for example ? > > The system must stay free during this time. > > Maybe it=B4s time to have a sleep_miliseconds( ) function... Try please my polyglot.zip package on RDS site. There is the deLay() procedure, which calibrate delay on given machine and can then give you to sleep microseconds. It is 3.2 microseconds minimum delay on my P166MMX. Lib is p-misc.e. Regards, Igor Kachan kinz at peterlink.ru