computing
  • 4

Solved Use Milliseconds Instead Of Seconds In Batch CHOICE Command

  • 4

I’m using “choice /d y /t 1 >nul” in this example
echo Hello world
choice /d y /t 1 >nul
echo Hello world 2
and the “choice /d y /t 1 >nul” is there to wait for 1 second but not show waiting in cmd and then show another echo, the thing that I wanted to do is make waiting less than 1 second, like half a second or even less, is that possible as the minimum value for /t is 0? Can I make it in milliseconds somehow? Thanks in advance!

EDIT: I’m quiet new to this stuff so don’t go hard on me please 😛

message edited by JustRelaxASC

Share

1 Answer

  1. TIMEOUT or CHOICE are the commonly used ones for batch. You’re not going to find something with millisecond precision for batch, because whatever you choose will have to spawn as a new process. That could take seconds, so finer precision isn’t required, and would just be misleading.

    This is different from other languages, as most of them implement a wait within the process running the script.

    How To Ask Questions The Smart Way

    • 0