Finding System/User/Real times on Win32 - URGENT! 
Author Message
 Finding System/User/Real times on Win32 - URGENT!

Hi,

I am looking for any functions avaliable for finding the above
times for a process. I am developing a timer class in C++, the
user of this class will start the timer -- do some work -- stop
the timer and would than like to know the real/user/system times
between the start and stop of the timer! In short I am looking
for the Win32 equivalent of the UNIX(!) function times()!

Any ideas appreciated!
Please mail me as I do not frequent this ng.

Thank you
--
Regards
Nilesh

-------------------------------------
Nilesh P. Kale
Mahindra British Telecom (Corp.Off:Pune, India)
http://www.*-*-*.com/
BT Labs, UK.    Tel: +44-1473-605836



Sun, 06 May 2001 03:00:00 GMT  
 Finding System/User/Real times on Win32 - URGENT!
Nilesh,

I believe that when timers are of top priority, you need to use the
Multimedia timers from th Mutlimedia API/SDK  -- they are more
accurate because system  WM_TIMER messages are given low priority

Charles Steinhardt[MVP]
(To Email: remove NO_SPAM_NO from return address)



Sun, 06 May 2001 03:00:00 GMT  
 Finding System/User/Real times on Win32 - URGENT!
As Charles explaned, WM_TIMER messages are very low priority. In fact, they
are not real messages, but seem to be implemented as flags, which means that
you'll only get a WM_TIMER message if no other messages are waiting around
in the message queue.

That said, I'll mention that you can't accuratelly get a timer with less
than 55 ms resolution using standard timers. To get better results, look
into using the multimedia timers, which are supposed to offer a 1 ms
resolution (but don't count on it!). To do this, look at the timeSetvent()
function.

--
Tomas Restrepo

http://members.xoom.com/trestrep/


Quote:
>Hi,

>I am looking for any functions avaliable for finding the above
>times for a process. I am developing a timer class in C++, the
>user of this class will start the timer -- do some work -- stop
>the timer and would than like to know the real/user/system times
>between the start and stop of the timer! In short I am looking
>for the Win32 equivalent of the UNIX(!) function times()!

>Any ideas appreciated!
>Please mail me as I do not frequent this ng.

>Thank you
>--
>Regards
>Nilesh

>-------------------------------------
>Nilesh P. Kale
>Mahindra British Telecom (Corp.Off:Pune, India)
>http://www.MahindraBT.com
>BT Labs, UK. Tel: +44-1473-605836



Sun, 06 May 2001 03:00:00 GMT  
 Finding System/User/Real times on Win32 - URGENT!

Quote:
>I am looking for any functions avaliable for finding the above
>times for a process.

Nilesh,

Have a look at QueryPerformanceCounter & QueryPerformanceFrequency.

Dave
----
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Mon, 07 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Finding System/User/Real times on Win32 - URGENT!

2. real-time vs. user-time

3. URGENT: Debug mode vs. Real Time

4. Help needed: COM in REAL-TIME systems.

5. Q: update system clock with real time clock

6. Real time system design with VC++

7. icon in the taskbar notification area(where we see the system time) (Urgent Help)

8. finding free system, GDI, and User

9. How to convert local time with specific time zone to UTC time in Win32 API

10. Help!: problem with fast timing for real-time application on PC

11. Real time From Time Zone information

12. Real Time and Timing

 

 
Powered by phpBB® Forum Software