Timer
-
Hi all!I have these two lines of codes in my program: float time = (float)DateTime.Now.Second; xyGraphControl1.AddPoint(time,power); The result of the codes is that the timer starts at the same second as the clock in my computer. How am I going to force the timer to always and only start at 0 second? Thank you very much!
-
Hi all!I have these two lines of codes in my program: float time = (float)DateTime.Now.Second; xyGraphControl1.AddPoint(time,power); The result of the codes is that the timer starts at the same second as the clock in my computer. How am I going to force the timer to always and only start at 0 second? Thank you very much!
What timer? Please provide some more details (code) about what you're trying to do.
-
What timer? Please provide some more details (code) about what you're trying to do.
Actually this timer is act like a stop watch in my program..So when everytime i press start button it will start run from 0 seconds until i press stop button to stop it.Now the problem is when i press the start button it start according to my computer time(second). float time =(float)DateTime.Now.Second ; xyGraphControl1.AddPoint(time, power); long StartClock; private void StartButton_Click(objectsender,System.EventArgse) { timer1.Start(); // get the exact hour started in milliseconds StartClock = DateTime.Now.Ticks; xyGraphControl1.Reset(); } Thank very much!
-
Actually this timer is act like a stop watch in my program..So when everytime i press start button it will start run from 0 seconds until i press stop button to stop it.Now the problem is when i press the start button it start according to my computer time(second). float time =(float)DateTime.Now.Second ; xyGraphControl1.AddPoint(time, power); long StartClock; private void StartButton_Click(objectsender,System.EventArgse) { timer1.Start(); // get the exact hour started in milliseconds StartClock = DateTime.Now.Ticks; xyGraphControl1.Reset(); } Thank very much!
levi`s wrote: float time =(float)DateTime.Now.Second ; xyGraphControl1.AddPoint(time, power); Ok, but what's with these lines of code? What should they do and in which context (method) do they stand?
-
levi`s wrote: float time =(float)DateTime.Now.Second ; xyGraphControl1.AddPoint(time, power); Ok, but what's with these lines of code? What should they do and in which context (method) do they stand?
-
the 1st line mean assign the time(second) in the my computer to float time and the 2nd mean add point to the graph with X-axis is time and Y-axis is power..So basically this AddPoint is add the point to the point to the graph
I guessed that. But where is that code and what does it has to do with your timer?