I can't replicate that problem with the code you listed.
Likewise, and I wrote the *censored* thing.
This variable !CR! is not even in the code so you got something screwed up.
Must be some extra code introduced. The code to echo the time, and that !CR! thing. I believe we are not seeing the code which is actually being run.
Also, that computer must be a stone dog if it is running the code with nothing else in the loop! Look at the time difference (30 ms) between the lines.
I duplicated the effect...
@echo off
REM Get a string to split
set /p String="Enter a string "
:Loop
REM Split string into 1st token and the remainder
for /f "tokens=1* delims=-" %%A in ("%String%") do (
REM Echo 1st token
echo The time now is %time%!CR!%%A
REM Assign remainder to %String%
set String=%%B
)
REM If %String% is a blank then we are finished
if "%String%"=="" goto Done
REM Otherwise go round again
goto Loop
:Done... and I could get 2 or 3 lines with the same 10 ms time timestamp:
I got this on a 3 GHz Phenom II system:
Enter a string 1-2-3-4-5-6-7-8-9-10-11-12-13-14-15
The time now is 20:15:39.55!CR!1
The time now is 20:15:39.55!CR!2
The time now is 20:15:39.55!CR!3
The time now is 20:15:39.56!CR!4
The time now is 20:15:39.56!CR!5
The time now is 20:15:39.57!CR!6
The time now is 20:15:39.57!CR!7
The time now is 20:15:39.57!CR!8
The time now is 20:15:39.58!CR!9
The time now is 20:15:39.58!CR!10
The time now is 20:15:39.59!CR!11
The time now is 20:15:39.59!CR!12
The time now is 20:15:39.59!CR!13
The time now is 20:15:39.60!CR!14
The time now is 20:15:39.60!CR!15And on a 2.2 GHz Core 2 Duo system:
The time now is 20:19:29.18!CR!1
The time now is 20:19:29.19!CR!2
The time now is 20:19:29.19!CR!3
The time now is 20:19:29.19!CR!4
The time now is 20:19:29.19!CR!5
The time now is 20:19:29.19!CR!6
The time now is 20:19:29.19!CR!7
The time now is 20:19:29.21!CR!8
The time now is 20:19:29.21!CR!9
The time now is 20:19:29.21!CR!10My guess is the OP is running some other code in the loop (which we are not being shown) which is taking up 30 mS per line.
Altogether, I think we are being messed with.