David Brown wrote: > > Designing a little clock .Net beastie. I'm unable to determine how, if even > possible, to have .Net tell me when the system clock updates (specifically, the > second). Currently I have a simple WinForm Timer object at 100ms and checking > the DateTime.Now for a changed value. Inefficient, but it works. > > Anyone know of a better way?
If you only want the seconds, set the interval to 1000ms (1 sec) instead of 100ms (1/10 sec). After you get your clock written, you can compare it to the clock example in Petzold's C# book. Like you, he used the Timer. However, he wanted the 1/10 sec update in order to show a sweeping second hand instead of the second hand jumps that would come from using the 1 sec interval. -- Tim Butterfield http://www.timbutterfield.com/ You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.