473,320 Members | 1,974 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,320 software developers and data experts.

Timer for windows console program

I'd like to log each stage of my programs progress through a 20 MB text
file with a log along lines of:

time - event

But I don't know how to get the time!

Is there a better way than some horrible system("dos stuff") type call?

Oct 6 '06 #1
4 4974
pkirk25 wrote:
I'd like to log each stage of my programs progress through a 20 MB
text file with a log along lines of:

time - event

But I don't know how to get the time!
RTFM about 'time' and 'clock' functions. Also, your OS probably has
some other mechanism for getting the time, read about it as well.
Is there a better way than some horrible system("dos stuff") type
call?
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 6 '06 #2
pkirk25 wrote:
I'd like to log each stage of my programs progress through a 20 MB text
file with a log along lines of:

time - event

But I don't know how to get the time!
Did you read the functions inside <time.h>?

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Oct 6 '06 #3
>
Did you read the functions inside <time.h>?
No - i googled timer and ended up with loads of MS links.

Thanks for that. Sorted now.

Oct 6 '06 #4
On 6 Oct 2006 13:42:02 -0700 in comp.lang.c++, "pkirk25"
<pa*****@kirks.netwrote,
>But I don't know how to get the time!
The usual answer to that is the same in C++ as it is in C, and is
covered in Steve Summit's C FAQ. It is always good to check the FAQ
before posting. You can get the FAQ at:
http://www.eskimo.com/~scs/C-faq/top.html
Oct 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: avivgur | last post by:
Hello, I have devised a console application that uses a System.Timers.Timer and its Elapsed event. The problem is that I want the program to continue to run so that each time the event is raised,...
3
by: jam | last post by:
Dear all, I am wrtiing a console application and doing some test on timer, the below is my sample code I got from some site, but I cannot make it work... Error is 'System.Timers.Timer' does not...
2
by: linesh.gajera | last post by:
Hi Guys, I am creating a Windows service that call a routine at given interval. Once routine is complete, windows service should wait for 5 minutes and then call the routine again. I was using...
3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
6
by: Aart Nicolai | last post by:
Hi all, I have developed a vb.net console application which will run some code every seconds. To get this working I used a timer "System.Timers". When I start my console application it exits...
9
by: archana | last post by:
Hi all, I want to know about interval of timer. I am using timer in windows service.I head somewhere that when i set interval property of timer while setting interval, restart time of Pc is...
4
by: Lauren Quantrell | last post by:
I have just put together a vb.net app and now need to provide it to users. This application needs to run the code in a sub every 60 seconds from a Windows Service application. I have the...
10
by: Joris De Groote | last post by:
Hi, I have wrote a program that checks for files and moves these files to the correct folders when they come in. Everything works fine. However I always have to start that program manually. I...
11
by: Hotrod2000 | last post by:
I'm quite new to programming but I'm having problems getting a timer to work in visual studio.net I've created a timer on a form, enabled it and then typed the following code (from the mdsn...
16
by: Peter Oliphant | last post by:
Note that although this involves SAPI, it is more a question about Timers and event handlers. I wrote a Speech Recognize handler (SAPI), and put some code in it to enable a Timer. It would not...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.