Search code examples
batch-filecommanddelayinternal

Delay in batch file, but without running any app (using only internal commands)


is there a way to delay a batch without running a app to cause the delay?

i did a program that monitor the creation of a file, and it need to rescan the file size every second, so i need to make a 1 second delay

but in some machines, antivirus and programs installed by banks cause the delay program to freeze and don't exit properly.

choice, sleep, timeout, ping, all are external apps.

is there a internal command that can delay 1 second without running any app, besides internal CMD command? creating loops is not a option, cause it will consume CPU (my app is a converter, so cannot consume CPU while wait...)

thanks in advance ;)


Solution

  • is there a internal command that can delay 1 second without running any app, besides internal CMD command? creating loops is not a option, cause it will consume CPU (my app is a converter, so cannot consume CPU while wait...)

    Answer - NO, not possible. There aren't many internal commands, and certainly none that can add a delay that does not consume CPU.