I would like to create a countdown timer for my game in Jack. Has anyone done something like this or have any suggestions to share on how to do this?
A few additional questions to this:
How would you control the precision of the clock?
How would constantly redrawing the screen (or the part of the screen where the timer is placed) affect the speed of the program?
There is no way to do accurate timing in Hack. You can use software delay loops to slow your program down and you can use the Sys.wait() function, but neither of these will be consistent from one computer to another.
How much the timer display will affect speed will depend on whether you are emulating the OS .vm files or using the built in OS functions.