473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

stopwatch program

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 !!!
Oct 4 '07 #1
4 8021
sicarie
4,677 Expert Mod 4TB
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)?
Oct 4 '07 #2
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
Oct 7 '07 #3
sicarie
4,677 Expert Mod 4TB
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.
Oct 8 '07 #4
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
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
Oct 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: luckyjameel | last post by:
Hi Guys Hope this message shall find u all in gr8 moods. As i was developing a Application for Online Exam and i am in need of a way to maintain the time for the logged in user. So Can any one...
5
by: Xero | last post by:
I have written a program that functions similarly to a stopwatch. When the user clicks the button, a label on the form starts counting. The program, however, does not tick once a second. How can I...
5
by: not_a_commie | last post by:
So I have a motherboard with multiple CPU sockets. It seems that if I create a StopWatch on one thread and then call the Elapsed member from a different thread that sometimes I get a tick count...
3
by: Jeff Jarrell | last post by:
I am unable to add up two timespans as created by the System.Diagnostics.Stopwatch class. Each stopwatch should be about two seconds and is appears ok, but when I try and add them up it goes to...
1
by: =?Utf-8?B?UmFqYQ==?= | last post by:
I am running a sample application that gives me performance time for each action. I am using Stopwatch class (found in System.Diagnostics namespace in ..Net 2.0) to get the Elapsed time. If I run...
4
by: PlusNet | last post by:
Why doesn't the following work? Dim MyStopwatch() as Stopwatch ...Later in the code redim preserve MyStopwatch(10) ...Later in the code MyStopwatch(1).start
8
by: Firecore | last post by:
Hello. I am making a Stopwatch program in C. Can anyone help? Is it possible to make a timer(stopwatch) function in C?
0
by: kerplunkwhoops | last post by:
Hello I am wanting to use the high accuracy of System.Diagnostics.Stopwatch to get the current time using GetTimeSpan. Underneath, System.Diagnostics.Stopwatch.GetTimeStamp uses the win32 API...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.