可能以下代码能说明一点问题:- @echo off&setlocal enabledelayedexpansion
- for /l %%a in (1,1,1000) do set /a "_%%a=1"
- for /l %%a in (1,1,100) do (
- set "t=!time!"
- for /l %%b in (1,1,10000) do set /a _%%a+=1
- set "t1=!time!"&set "a="
- if "!t:~,2!" lss "!t1:~,2!" set "a=+24"
- set /a ".%%a=(!t1:~,2!-!t:~,2!!a!)*360000+(1!t1:~3,2!%%100-1!t:~3,2!%%100)*6000+(1!t1:~6,2!%%100-1!t:~6,2!%%100)*100+(1!t1:~-2!%%100-1!t:~-2!%%100)"
- )
- set .
- pause>nul
复制代码 这是将_1到_100变量计算10000次的时间(ms)用.1到.100变量储存然后列出,本机上运行结果如下:- .1=50
- .10=54
- .100=69
- .11=54
- .12=57
- .13=57
- .14=59
- .15=63
- .16=62
- .17=66
- .18=67
- .19=70
- .2=62
- .20=68
- .21=70
- .22=72
- .23=73
- .24=75
- .25=78
- .26=78
- .27=80
- .28=85
- .29=82
- .3=78
- .30=83
- .31=85
- .32=87
- .33=88
- .34=89
- .35=90
- .36=96
- .37=93
- .38=97
- .39=100
- .4=91
- .40=97
- .41=100
- .42=101
- .43=103
- .44=105
- .45=108
- .46=109
- .47=111
- .48=114
- .49=116
- .5=106
- .50=112
- .51=114
- .52=118
- .53=118
- .54=119
- .55=123
- .56=124
- .57=126
- .58=127
- .59=128
- .6=119
- .60=130
- .61=128
- .62=133
- .63=133
- .64=134
- .65=137
- .66=138
- .67=140
- .68=141
- .69=144
- .7=131
- .70=143
- .71=146
- .72=146
- .73=147
- .74=152
- .75=151
- .76=154
- .77=154
- .78=156
- .79=159
- .8=145
- .80=158
- .81=160
- .82=161
- .83=166
- .84=175
- .85=194
- .86=178
- .87=174
- .88=173
- .89=177
- .9=159
- .90=173
- .91=175
- .92=176
- .93=180
- .94=180
- .95=182
- .96=185
- .97=184
- .98=191
- .99=187
复制代码 从这个运行结果可以看出确实变量名的存储和读取是按照cmd默认序列进行的。 |