473,398 Members | 2,393 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,398 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 8027
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.