Simple Answer
Use choice /t
as your clock tick.
@echo off
setlocal
set "count=0"
:clock
echo Seconds: %count%
choice /t 1 /c am /d a >nul
if %ErrorLevel% equ 2 goto done
set /a "count+=1"
goto clock
:done
echo Menu
pause
endlocal
Note: the timeout granularity for choice is limited to seconds with a range from 1 to 9999 seconds. Also, there will be time decay using a software based clock. From a rough quick test this has about a 1/10th second per second decay. Meaning that ever 10 seconds this clock will loose 1 second.
OP's Related Posts
Decay-less Clock Example
Since my answer to your other question, I have created this clock that is not susceptible to script decay, as it adjusts based upon the OS clock every tick. Meaning, even if there is decay in the script, the clock will not display the wrong time.
@echo off
setlocal
:initialize
set "s=10"
set "m=10"
:: Note Offset
set "xs=%time:~6,1%" & set "sx=%time:~7,1%"
set "xm=%time:~3,1%" & set "mx=%time:~4,1%"
set "so=%xs:0=%%sx%" & set "mo=%xm:0=%%mx%"
echo Offset: %mo% : %so%
:process
:: Calculate Changes
set "xs=%time:~6,1%" & set "sx=%time:~7,1%"
set "xm=%time:~3,1%" & set "mx=%time:~4,1%"
set "xs=%xs:0=%" & set "xm=%xm:0=%"
if %xs%%sx% lss %so% set "xs=60+%xs%"
if %xm%%mx% lss %mo% set "xs=60+%xm%"
set /a "s=%xs%%sx%-%so%"
if %s% equ 0 set /a "m=%xm%%mx%-%mo%"
:: Pause Processing supports millisecond delay but not input checking
::ping 192.0.2.2 -n 1 -w 200 >nul
:: Break Check supports input checking but not millisecond delay
choice /T 1 /C am /D a >nul
if %ErrorLevel% equ 2 goto menu
:display
:: Detect Lag
set "w="
if %s%0 equ %bs%0 goto process
if %s%0 lss %bs%0 set "w=lag detected"
if %s%0 geq %es%0 set "w=lag detected"
:: Format Output
set "mm=00%m%"
set "ss=00%s%"
set "bm=%m%"
set "bs=%s%"
set /a "es=%s%+2"
:: Display
echo Clock: %mm:~-2% : %ss:~-2% %w%
goto process
:menu
echo Menu
endlocal
exit /b 0
Note: This is based upon en-US time format.
Output Example
Offset: 45 : 10
Clock: 00 : 01 lag detected
Clock: 00 : 02
Clock: 00 : 03
Clock: 00 : 04
Clock: 00 : 05
Clock: 00 : 06
Clock: 00 : 07
Clock: 00 : 08
Clock: 00 : 09
Clock: 00 : 11 lag detected
Clock: 00 : 12
Clock: 00 : 13
Clock: 00 : 14
Clock: 00 : 15
Clock: 00 : 16
Clock: 00 : 17
Clock: 00 : 18
Clock: 00 : 19
Clock: 00 : 20
Clock: 00 : 21
Menu