Click here to Skip to main content
15,921,548 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOpening an access database in VC++ Pin
shypht3-Mar-02 8:36
shypht3-Mar-02 8:36 
GeneralRe: Opening an access database in VC++ Pin
Michael P Butler3-Mar-02 9:48
Michael P Butler3-Mar-02 9:48 
GeneralRe: Opening an access database in VC++ Pin
shypht3-Mar-02 12:26
shypht3-Mar-02 12:26 
GeneralRe: Opening an access database in VC++ Pin
Phil J Pearson4-Mar-02 4:23
Phil J Pearson4-Mar-02 4:23 
Questiondetermine cpu time of a process ? Pin
3-Mar-02 8:15
suss3-Mar-02 8:15 
AnswerRe: determine cpu time of a process ? Pin
alex.barylski3-Mar-02 9:10
alex.barylski3-Mar-02 9:10 
GeneralRe: determine cpu time of a process ? Pin
3-Mar-02 9:48
suss3-Mar-02 9:48 
GeneralRe: determine cpu time of a process ? Pin
alex.barylski3-Mar-02 13:46
alex.barylski3-Mar-02 13:46 
When I said clocks of the current process this was a bit of a misnomer. You can retrieve the clocks used by your own applications process. Not the process with the highest current priority or the process behind the active window.

There are several techniques available each will vary in accuracy.

1) QueryPerformanceCounter() - I have read that this techinque has is not that accurate. However it will run under Win95/NT and up.

2) clock() found in the CRT should lend itself nicely to what you want to do.

3) RTDSC intel ONLY instruction...I would argue that this is probably the most effective at returning an accurate reading of clocks expended. However side effects are...you'd have to record clocks at the start and end of each function calculate the sum and then the difference of total expended clocks to calculate percentage of CPU used by the process. Also...your code will only run on intel machines. And the is a known quirk with the RTDSC instruction that requires you to perform a cache warm-up because the instruction returns a higher count than it should on it's first execution. this can complicate matters a little.

I've never tried using the clock() of the crt, but it sounds like it returns the clocks spent of the current process...if this is true you can avoid cache warmups and recording at the start and end of each function.

Are you trying to profile your code...or just return CPU useage on a system wide basis..at first it sounded like you were trying to profile the system, but if your trying to profile your code...I would suggest going with the RTDSC method...

Cheers!

"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
Generalmerge sort Pin
3-Mar-02 5:46
suss3-Mar-02 5:46 
GeneralRe: merge sort Pin
Michael Dunn3-Mar-02 7:25
sitebuilderMichael Dunn3-Mar-02 7:25 
Generalplease.........................please..................... Pin
3-Mar-02 4:49
suss3-Mar-02 4:49 
GeneralRe: please.........................please..................... Pin
Tim Smith3-Mar-02 5:10
Tim Smith3-Mar-02 5:10 
Generalhere is one memory leak Pin
3-Mar-02 5:11
suss3-Mar-02 5:11 
GeneralRe: here is one memory leak Pin
Christian Graus3-Mar-02 9:02
protectorChristian Graus3-Mar-02 9:02 
GeneralRe: Thanks i got the solution Pin
5-Mar-02 4:08
suss5-Mar-02 4:08 
GeneralRe: Thanks i got the solution Pin
5-Mar-02 4:08
suss5-Mar-02 4:08 
GeneralVSS Header comments Pin
Darren Schroeder3-Mar-02 4:39
Darren Schroeder3-Mar-02 4:39 
GeneralRe: VSS Header comments Pin
Anders Molin3-Mar-02 4:43
professionalAnders Molin3-Mar-02 4:43 
Questionusing namespace std; <-- is evil? Pin
Travis D. Mathison3-Mar-02 4:28
Travis D. Mathison3-Mar-02 4:28 
AnswerRe: using namespace std; <-- is evil? Pin
Todd Smith3-Mar-02 4:41
Todd Smith3-Mar-02 4:41 
AnswerRe: using namespace std; <-- is evil? Pin
Tim Smith3-Mar-02 5:00
Tim Smith3-Mar-02 5:00 
AnswerRe: using namespace std; <-- is evil? Pin
Travis D. Mathison3-Mar-02 5:07
Travis D. Mathison3-Mar-02 5:07 
AnswerRe: using namespace std; <-- is evil? Pin
Felix Cho3-Mar-02 12:37
Felix Cho3-Mar-02 12:37 
GeneralRe: using namespace std; <-- is evil? Pin
Christian Graus3-Mar-02 12:57
protectorChristian Graus3-Mar-02 12:57 
GeneralRe: using namespace std; <-- is evil? Pin
Tim Smith3-Mar-02 13:11
Tim Smith3-Mar-02 13:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.