Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

TIMER causes confusion

May
12,845
164
I couldn't think of a better title for the post. I haven't got a clue what's happening below.

Code:
v:\> (do i=1 to 5 ( echo %i ))
1
2
3
4
5

v:\> timer (do i=1 to 5 ( echo %i ))
Timer 1 on: 12:54:17
6
6
6
6
6
Timer 1 off: 12:54:17  Elapsed: 0:00:00.003

It's the same without the extra parentheses.

Code:
v:\> do i=1 to 5 ( echo %i )
1
2
3
4
5

v:\> timer do i=1 to 5 ( echo %i )
Timer 1 on: 12:53:42
6
6
6
6
6
Timer 1 off: 12:53:42  Elapsed: 0:00:00.004
 
I get it. TIMER is dumb. It expands everything on its command line.

Code:
v:\> timer (do i=1 to 3 ( echo %%i ))
Timer 1 on: 13:10:36
1
2
3
Timer 1 off: 13:10:36  Elapsed: 0:00:00.003

v:\> timer (do i=1 to 3 ( echo %i ))
Timer 1 on: 13:11:00
4
4
4
Timer 1 off: 13:11:00  Elapsed: 0:00:00.003
 

Similar threads

Back
Top