回复 67# aloha20200628
大佬,我使用set /a 测试了一下
- @echo off
- for /l %%l in (1,1,5) do (
- timeout 3 >nul
- setlocal
- echo 紧凑型
- call echo %%time%%
- call :1
- call echo %%time%%
- endlocal
- echo=
- timeout 3 >nul
- setlocal
- echo 分散型
- call echo %%time%%
- call :2
- call echo %%time%%
- endlocal
- echo=
- )
- pause
- exit
-
- :1
- for /l %%l in (1,1,10000) do (
- set /a a=1&set /a b=2&set /a c=3&set /a d=4&set /a e=5&set /a f=6&set /a g=7
- )
- exit /b
- :2
- for /l %%l in (1,1,10000) do (
- set /a a=1
- set /a b=2
- set /a c=3
- set /a d=4
- set /a e=5
- set /a f=6
- set /a g=7
- )
- exit /b
复制代码
- 紧凑型
- 17:15:34.13
- 17:15:38.26
-
- 分散型
- 17:15:41.12
- 17:15:45.01
-
- 紧凑型
- 17:15:48.19
- 17:15:52.18
-
- 分散型
- 17:15:55.16
- 17:15:59.17
-
- 紧凑型
- 17:16:02.14
- 17:16:06.23
-
- 分散型
- 17:16:09.20
- 17:16:13.18
-
- 紧凑型
- 17:16:16.18
- 17:16:20.20
-
- 分散型
- 17:16:23.16
- 17:16:27.09
-
- 紧凑型
- 17:16:30.16
- 17:16:34.17
-
- 分散型
- 17:16:37.16
- 17:16:41.06
-
- 请按任意键继续. . .
复制代码
用&连接,效率反而要低些 |