China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-20 20:15
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Are there any more clever techniques for batch processing delays? DigestI View 32,801 Replies 71
Floor 16 Posted 2006-12-26 19:27 ·  新西兰 奥克兰大区 奥克兰 Microsoft
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
If using the method of pinging an empty IP, can the default packet size be changed to 1 byte available?
Floor 17 Posted 2007-03-28 02:32 ·  IANA 局域网IP(Private-Use)
初级用户
★★
Credits 186
Posts 92
Joined 2007-03-27 08:20
19-year member
UID 83047
Gender Male
Status Offline
Strong support, top!
Floor 18 Posted 2007-04-14 04:10 ·  中国 湖北 武汉 电信
中级用户
★★
scriptlover
Credits 328
Posts 131
Joined 2007-03-25 22:17
19-year member
UID 82910
Gender Male
Status Offline
I know a great trick for delay. Thanks to the expert!!!
Floor 19 Posted 2007-04-17 01:07 ·  中国 上海 长宁区 电信
初级用户
Credits 38
Posts 15
Joined 2007-04-13 20:38
19-year member
UID 85037
Gender Male
Status Offline
Nice
Floor 20 Posted 2007-04-17 02:13 ·  中国 上海 普陀区 电信
新手上路
Credits 13
Posts 8
Joined 2007-04-17 00:54
19-year member
UID 85416
Gender Male
Status Offline
Thanks
Floor 21 Posted 2007-04-17 09:12 ·  中国 广东 广州 海珠区 电信
银牌会员
★★★
Credits 1,206
Posts 517
Joined 2007-03-25 01:18
19-year member
UID 82819
Gender Male
Status Offline
WSCRIPT.SLEEP 1000

There is an error in this. Depending on the CPU speed, the error is between 0.01 - 0.03 seconds.

This data was obtained from more than 2000 delay 500 statistics.

Suppose the output count takes 0.01 seconds.

The error is also between 0.02 seconds.
知,不觉多。不知,乃求知
Floor 22 Posted 2007-04-23 05:37 ·  中国 江苏 南通 电信
新手上路
Credits 2
Posts 1
Joined 2007-04-23 05:02
19-year member
UID 86156
Gender Male
Status Offline
Floor 23 Posted 2007-04-23 16:23 ·  中国 新疆 博尔塔拉蒙古自治州 电信
初级用户
Credits 34
Posts 16
Joined 2007-04-23 13:17
19-year member
UID 86201
Gender Male
Status Offline
Top. I'm here at DOS Union for the first time. I've learned a lot. Hehe. I've seen many experts. Hope the experts can give more guidance.
Floor 24 Posted 2007-05-08 12:34 ·  中国 北京 海淀区 联通
新手上路
Credits 2
Posts 1
Joined 2007-05-08 11:58
19-year member
UID 87843
Gender Male
Status Offline
Learned quite a lot
Floor 25 Posted 2007-05-08 14:00 ·  中国 山东 临沂 联通
新手上路
Credits 17
Posts 10
Joined 2007-05-08 11:01
19-year member
UID 87836
Gender Male
Status Offline
What a good thing! I'll download it and try it out.
Floor 26 Posted 2007-05-10 13:59 ·  中国 陕西 西安 电信
新手上路
Credits 5
Posts 4
Joined 2007-05-10 13:52
19-year member
UID 88075
Gender Male
Status Offline
The OP is absolutely right
Floor 27 Posted 2007-05-13 01:34 ·  中国 浙江 宁波 电信
中级用户
★★
Credits 363
Posts 162
Joined 2007-04-22 21:31
19-year member
UID 86104
Gender Male
Status Offline
Learning
Floor 28 Posted 2007-05-14 01:39 ·  中国 上海 闵行区 电信
新手上路
Credits 4
Posts 2
Joined 2007-05-14 00:55
19-year member
UID 88447
Gender Male
Status Offline
Well, I happen to be writing a batch script today and need a delay program. I refer to the code from大侠 PPdos, wrote one myself, which can achieve delay processing within 60 seconds. Well, the error... should say within one second. It's enough for casual use.

Call :BatchDelay 3
Goto Eof

:BatchDelay
Set /a delayLen=%1 %% 60
Set nowtime=%TIME:~6,-3%
Set /a delayEnd=%nowtime%+%delayLen%
Set /a delayEnd=%delayEnd% %% 60
:BatchDelay2
Echo %delayEnd% %TIME:~6,-3%
Set nowtime=%TIME:~6,-3%
If %delayEnd% NEQ %nowtime% Goto :BatchDelay2
Goto Eof

:Eof
Floor 29 Posted 2007-05-14 02:06 ·  中国 上海 闵行区 电信
新手上路
Credits 4
Posts 2
Joined 2007-05-14 00:55
19-year member
UID 88447
Gender Male
Status Offline
I'm sorry, there was an issue with the DOS octal automatic conversion in the previous segment, which I didn't consider when writing it. Now it's corrected.

:BatchDelay
Set /a delayLen=%1 %% 60
Set nowtime=%TIME:~6,-3%
If %nowtime:~0,1% EQU 0 Set nowtime=%nowtime:~-1%
Set /a delayEnd=%nowtime%+%delayLen%
Set /a delayEnd=%delayEnd% %% 60
:BatchDelay2
Set nowtime=%TIME:~6,-3%
If %nowtime:~0,1% EQU 0 Set nowtime=%nowtime:~-1%
Echo %delayEnd% %nowtime%
If %delayEnd% NEQ %nowtime% Goto :BatchDelay2
Goto Eof
Floor 30 Posted 2007-06-05 20:11 ·  中国 广东 东莞 电信
新手上路
Credits 10
Posts 3
Joined 2007-06-04 13:12
19-year member
UID 90226
Gender Male
Status Offline
Why does using ping -n 40 127.1>nul 2>nul work on my computer but seem to not work on a computer without internet?
Forum Jump: