Jump to content

Handle a signal: Difference between revisions

Omit Batch file
(Omit Batch file)
Line 1:
{{task|Concurrency}} {{requires|Signal handling}} [[Category:Signal handling]]
{{omit from|Erlang|Does not handle signals.}}
{{omit from|Batch File|"Pure" Batch files cannot really handle signals.}}
{{omit from|GUISS}}
{{omit from|M4}}
Line 143 ⟶ 144:
6
Task took 3.526 Seconds</pre>
 
=={{header|Batch File}}==
 
<lang Batch File>@echo off
set IntEchoedTimes= 0
echo X to send terminate signal
:LoopStart
set/a "IntEchoedTimes"= %IntEchoedTimes% + 1
choice /C 7X /N /T "1" /D 7
if %ERRORLEVEL% == 1 goto LoopStart
if %ERRORLEVEL% == 2 goto Terminate
:Terminate
echo The program has been running for %IntEchoedTimes% seconds.
echo Terminating...
timeout /t 3 /nobreak >nul
exit
</lang>
 
=={{header|BBC BASIC}}==
535

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.