@b.grigorev
within AM, I don't know.
with an external script (like autoit) on windows:
#include <Timers.au3>
;idle time in seconds
$time=10
While 1
If _Timer_GetIdleTime() >= 1 * $time * 1000 Then
;systems in taskmanager
ProcessClose("zsnesw.exe")
ProcessClose("mame64.exe")
ProcessClose("notepad.exe")
EndIf
WEnd
Open taskmanager > start your emulator > check process name > add the process name in sourcecode
script waits specified seconds and close all enclosed process