Subj : Re: real time clock in turbo C ver3.0 To : comp.programming From : [Jongware] Date : Thu Oct 06 2005 12:29 pm "ramsa" wrote in message news:1128573226.516382.93660@g49g2000cwa.googlegroups.com... > hi all, > > i am developing one application in turboC version3.0 , i want to > display the date & time at the console. > > now iam using the gettime & getdate structures in turboC > > but i need to run the time continuously. Approach #1. If your app runs in a continuous loop w/o too much interruptions you could patch the refresh of time and date into that same loop. I used to have an inkey() routine which waited for any keypress, a handy place to put this refresh in 'cause it gets called continuously and has to wait for the user. Pro: Easy to program. Con: clock refresh will halt whenever the computer gets busy. Approach #2. Turbo C -- sounds like an MS-DOS app. It's possible to set up a timer routine hooked into the system clock. This routine should do as little as possible, but showing just the time/date string shouldn't take too long. There are a number of caveats -- I recall that using sprintf is a bad idea because of the large stack -- but sample code for this can be found all over the web. Pro: Difficult to stop! I even found it running when the rest of my app crashed. Still, I guess it's a pro... Con: Hard to program and nearly impossible to debug. IDEs get very upset by these things. [jongware] .