Have you looked for Jeff Hicks, he has already developed a solution, you really need to run in a framework outside the terminal.
Jeff Hicks PSClock