[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linrad] Re: Resources



http://www.codeproject.com/atl/desktop_perf_mon.asp

The calls and their formats are all embedded in this project. As you might expect, you have to wade through all of the MFC (pre-.Net) SHTUFFF to get past the GUI mess to see the structs that have to be loaded up to make the calls to the Windows kernel.

Bob







Robert McGwier wrote:

I see. This is a high performance timer. It is not a "CPU meter". The issue on Windows is that while Windows does give you this information, it is crap. They do not charge themselves for kernel calls. You can have an almost completely hosed machine and the CPU % will be tiny. You can indeed use the HPC stuff I gave you to find elapsed time but what you want is the real loading. You want to use the performance monitoring functions (preferrable to the registry reads but I have little experience with them).

Bob





Robert McGwier wrote:

#include <stdio.h>
#include <windows.h>

main()
{
   LARGE_INTEGER frequency,counter, oldcounter;
   BOOL Result;
   int i=0;

   Result = QueryPerformanceFrequency(&frequency);
   Result = QueryPerformanceCounter(&oldcounter);
   do {

       Sleep(1);
               } while( i++ < 10);
   QueryPerformanceCounter(&counter);
printf("Elapsed time is %lf\n", ((double)counter.QuadPart - (double)oldcounter.QuadPart)/(double)frequency.QuadPart);
   printf("done\n");
}



Link with kernel32.dll

Bob





Joe Taylor wrote:

Bill --

Linrad is a complicated program with very tight real-time constraints. As a consequence, Leif prefers a lean-and-mean approach in which one can understand, at a detailed level, as much as possibly of what is going on.

If the access to the Registry is required, so be it. If you can produce a simple C routine that wraps the necessary system calls and produces a fractional CPU load, so that another C routine can access it, I am sure that Leif would greatly appreciate it!

With best wishes,

    -- 73, Joe, K1JT

Bill Tracey wrote:

Don't know that there is a single call to do it .. the Pdh/registry stuff can do it from straight C -- takes a few calls though. What's the issue with looking in the Registry?

Cheers,

Bill (kd5tfd)

At 09:08 PM 8/25/2005, Joe Taylor wrote:

Thanks, Bill. I have found references like the URL you kindly provided.

What we are looking for, I'm afraid, is a way to get at the desired information from "plain old C". No C#, no .Net, no Registry, just a plain vanilla system call. As far as I can tell, one does not exist in Windows.
                        -- Joe, K1JT




#############################################################
This message is sent to you because you are subscribed to
 the mailing list <linrad@xxxxxxxxxxxxxxxxxxxxx>.
To unsubscribe, E-mail to: <linrad-off@xxxxxxxxxxxxxxxxxxxxx>
To switch to the DIGEST mode, E-mail to <linrad-digest@xxxxxxxxxxxxxxxxxxxxx> To switch to the INDEX mode, E-mail to <linrad-index@xxxxxxxxxxxxxxxxxxxxx>
Send administrative queries to  <linrad-request@xxxxxxxxxxxxxxxxxxxxx>






#############################################################
This message is sent to you because you are subscribed to
 the mailing list <linrad@xxxxxxxxxxxxxxxxxxxxx>.
To unsubscribe, E-mail to: <linrad-off@xxxxxxxxxxxxxxxxxxxxx>
To switch to the DIGEST mode, E-mail to <linrad-digest@xxxxxxxxxxxxxxxxxxxxx> To switch to the INDEX mode, E-mail to <linrad-index@xxxxxxxxxxxxxxxxxxxxx>
Send administrative queries to  <linrad-request@xxxxxxxxxxxxxxxxxxxxx>






#############################################################
This message is sent to you because you are subscribed to
 the mailing list <linrad@xxxxxxxxxxxxxxxxxxxxx>.
To unsubscribe, E-mail to: <linrad-off@xxxxxxxxxxxxxxxxxxxxx>
To switch to the DIGEST mode, E-mail to <linrad-digest@xxxxxxxxxxxxxxxxxxxxx> To switch to the INDEX mode, E-mail to <linrad-index@xxxxxxxxxxxxxxxxxxxxx>
Send administrative queries to  <linrad-request@xxxxxxxxxxxxxxxxxxxxx>






#############################################################
This message is sent to you because you are subscribed to
 the mailing list <linrad@xxxxxxxxxxxxxxxxxxxxx>.
To unsubscribe, E-mail to: <linrad-off@xxxxxxxxxxxxxxxxxxxxx>
To switch to the DIGEST mode, E-mail to <linrad-digest@xxxxxxxxxxxxxxxxxxxxx>
To switch to the INDEX mode, E-mail to <linrad-index@xxxxxxxxxxxxxxxxxxxxx>
Send administrative queries to  <linrad-request@xxxxxxxxxxxxxxxxxxxxx>

LINRADDARNIL
D