Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hey Guys, How are you i hope you will be fine well my question is there any way to make digital clock in C# without timer because when I use timer so my application working very slow I want to show system date and time in my application without timer is there anyway so please help me how can I do it
Thanks

What I have tried:

label2.text = system.datetime.now.tostring();
Posted
Updated 25-Jun-17 0:23am
Comments
Patrice T 24-Jun-17 23:31pm    
"when I use timer so my application working very slow"
Does it imply that the app is fast without the clock ?

Well, yes. But, a Timer is the easiest way to go. If you code is "slow", not using a Timer isn't going to fix anything. The problem isn't with your Timer but with something else in your code.

Start with profiling your code to see where the bottlenecks are.
 
Share this answer
 
Here is an answer that will suit you: a digital clock program in c# ![^]
Quote:
One hint: use thread, not a timer and, in the thread body also use System.DateTime. Even with timer, always take time from this structure, never rely on timer's timing. (But avoid a timer, a thread is much easier, safer and more correct, in general; make thread body a cycle calling System.Threading.Thread.Sleep with the sleep time less then a second.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900