Whenever I required a timer in my programs, I always used the command
ping localhost -n %number% > nul
But lately, I have been working on a pretty complex program that requires me to run a timer in the background while other code right after it keeps running. I have never had this problem since whenever I encounter a situation like this, I always simply made my programs start other programs that would keep a track of time for them. But this program is different, this time the timer needs to be run very often and more often than not will only continue for a few seconds. Opening a separate program each time the program needs to keep a track of time would just be too messy. Is there anything that you may know of that could possibly start up a timer like this in the background?