Create an application that restarts itself after n-seconds once In your favorite programming language, create an application that restarts itself once, after n seconds.

You need to find a way to restart after exiting the program. EG: run cmd to do it for you. Make sure it waits an amount of seconds specified by the user before restarting

For clarification: You can run a second program, or compile one at runtime to do the work for you.

Also, make sure the program works every time you execute it, not only once.

Example of algorithm:

If hasntrestartedalready
    read i
    exit
    wait(i)
    restart
end if


Least amount of bytes wins.
Batch, 34 28 bytes

timeout/t %1
if %1 neq [] %0


Input time in seconds as the first argument. If no argument is present, as well as after restarting, it spews out error messages (follow both commands with 2&gt;NUL to get rid of them). The new instance opens in the same window (OP said it's allowed).