SetLocal EnableExtensions EnableDelayedExpansion
If "%1"=="" Exit
If %1 LSS 0 GoTo :EOF
If %1 GTR 999 GoTo :EOF
Set pDelay=%1
Set iDelay=0
Set pTime=%Time:~7,1%
:WAIT
Set iTime=%Time:~7,1%
If %iTime% == %pTime% GoTo :WAIT
Set pTime=%iTime%
Set /a iDelay=%iDelay%+1
If %iDelay% LSS %pDelay% GoTo :WAIT
EndLocal