Connecting Tech Pros Worldwide Help | Site Map

stopwatch program

Newbie
 
Join Date: Oct 2007
Posts: 2
#1: Oct 4 '07
hi! Please somebody help me

I'm really a newbie for C++

I have a task to create stopwatch program using C++

What should I write at C++??

please help me !!!
sicarie's Avatar
Moderator
 
Join Date: Nov 2006
Location: USA
Posts: 3,929
#2: Oct 4 '07

re: stopwatch program


Quote:

Originally Posted by reinhart

hi! Please somebody help me

I'm really a newbie for C++

I have a task to create stopwatch program using C++

What should I write at C++??

please help me !!!

Sure we can help, but we need a bit more than "What should I write". I'm guessing you want to do this in seconds/minutes, etc... Have you looked at any of the time libraries (like time.h)?
Newbie
 
Join Date: Oct 2007
Posts: 2
#3: Oct 7 '07

re: stopwatch program


Quote:

Originally Posted by sicarie

Sure we can help, but we need a bit more than "What should I write". I'm guessing you want to do this in seconds/minutes, etc... Have you looked at any of the time libraries (like time.h)?

so, I should use time.h as header and ...
I don't know about the function of time.h
would tell me??
write the listing program of stopwatch??
I'm really need your help...
I'm so stupid at C++
thanks a lot before
sicarie's Avatar
Moderator
 
Join Date: Nov 2006
Location: USA
Posts: 3,929
#4: Oct 8 '07

re: stopwatch program


Have you looked at the functions of the link I posted? If you drill down into them, you will find several things that will help you. I would recommend reading through those, and that should give you enough information to be able to create your algorithm for your program.
Newbie
 
Join Date: Oct 2007
Posts: 10
#5: Oct 8 '07

re: stopwatch program


yeh you should really try to make and pseudocode algorith first then you can worry about the code.

if you would tell us exactly what u want would be easier for us to help.

here is a tip though using the time.h header
Quote:
int totalTime=0;
time_t start,end;

time(&start);
.
. // do code here or loop till you want it to stop
.
time(&end);

totalTime = end-start;
totalTime will then contain the time in seconds between the start and end
Reply