Timer

R

rainny

I have 2 buttons, which are start and stop button. When I click on the
start button, i make the timer is counting while click on the stop
button, it will stop counting the time.
The problem I face here is if I click back start button, is it
possible for the time reset to 0.00 sec which means that the time is
start to re-count again? It also means that the time would not
continue back the previous time which I stop whereas is start to count
the time start from 0 second again.

If anyone can help, thank you.
 
R

Roedy Green

I have 2 buttons, which are start and stop button.

A Timer is like a an alarm clock. It goes off by itself at some time
in the future and triggers some action. To solve that sort of problem,
see http://mindprod.com/jgloss/timer.html

To measure elapsed time, you sample the time of day clock and
subtract. You can get "lap" times and the whole "race" time by
subtracting different time samplings.

see http://mindprod.com/jgloss/time.html
for more information.
--
Roedy Green Canadian Mind Products
http://mindprod.com

When you are programming and you feel paralysis from overwhelm:
(o) Write down your worries in an electronic todo list, so you can temporarily stop thinking about them.
(o) Write smaller modules and classes so you don’t need to juggle many facts to complete the code.
(o) Do some necessary, but simple, clerical task.
(o) Solve some simple problem with at least some probability of being useful in the big solution. It will break the logjam.
~ Roedy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top