A very simple batch file clock to run in a command prompt or powershell window.
This was intially written to watch for OS freezes for Wolf68k, when he was streaming. The concept is simple: show an ever changing display which will cease updating during system freezes. I’ll go over the lines one at a time below.
|title JDenslinger's local system Time
| | cls
| | echo %time%
| | ping localhost -n 1 >null
| goto CLOCK
wordpress seems to want to delete all my extra space. I hate it. so, here, in the code section, there is a pipe | preceeding the lines. Remove the pipes if you use this code, otherwise it will not function properly or at all!
– Ths provides for the system to not show any of the commands, and to only output the time
title JDenslinger’s local system Time
– two parts here, to form the titlebar display:
— title – the command to initiate the titlebar display
— JDenslinger’s local system time – the words to be displayed.
– the background (0) and text (a) colors, black and lime, respectively
– clears the screen, ensuring that the display is only a single line
– basic function pointer, can be called later in the script
– this clears the previous time allow for the new time to be displayed
– echo (output to the display) the current time (%time% is a system variable)
ping localhost -n 1 >null
– poor man’s timer. On very slow systems, this can more close to a second or longer delay.
– This directs the script to go back to our function pointer, creating an infinite loop.
This script can be stopped with ctrl-c or by closing the window.