c# - How to snapshot the speed of a processor's individual cores in MHz -


I would like to create an application that monitors frequencies of a core and for a user, the system's processor will have MHz. I have done other applications like that, so I know that this should be possible.

I have tried to find a solution on stack overflow, but I could not find it. , Which could speak for the implementation of an anti-fraud in C ++, and did not provide a real solution, but there is an important danger: "Making power management technologies more common in today's computers, A commonly used method can achieve higher-resolution CPU time, RDTSC directive, can not work as expected. " Is.

The closest thing I've seen is that, but the processor's personal core does not respond to the speed of the processor.

There is also a development kit which I do not have the money.

So ... back to the question, how can I get the current snapshot of the clock speed of a core of the program? There should be a way.

P.S. With the increase of Turbo and other technologies, core speed variables are the reason why I want to get this information as the current time snapshot. For the purposes of monitoring, such an application will be useful to the end user so that he or she is working properly, that they are working properly, and to monitor their systems. Allow and see how the performance is under load, etc. Apart from this, there is no harm in knowing how to obtain this data. Try it by somebody else:

  
#include & lt; NTstatus.h & gt; #define WIN32_NO_STATUS #include & lt; Windows.h & gt; # Include & lt; Powrprof.h> # Include & lt; Iostream & gt; Typedef structure _PROCESSOR_POWER_INFORMATION {ULONG number; Ulong Max Mehz; Ullang Chuenheim; Ulanog Massilimit; Ulhone Max Idlestate; Ollang current Idestalstate; } PROCESSOR_POWER_INFORMATION, * PPROCESSOR_POWER_INFORMATION; #pragma Comment (lib, "Powrprof.lib") int main () {// Get the number or processor SYSTEM_INFO si = {0}; :: GetSystemInfo (& amp; c); // Assign buffer to get information for each processor int size = si.dwNumberOfProcessors * sizeof (PROCESSOR_POWER_INFORMATION); LPBET Pibber = new byte [size]; NTSTATUS status = :: Call notification information (processor notification, zero, 0, pubfire, size); If (STATUS_SUCCESS == status) {// list each processor frequency PPROCESSOR_POWER_INFORMATION ppi = (PPROCESSOR_POWER_INFORMATION) pBuffer; (DWORD nIndex = 0; nIndex & lt; si.dwNumberOfProcessors; nIndex ++) {std :: cout & lt; & Lt; "Processor #" & lt; & Lt; Ppi- & gt; Number & lt; & Lt; "Frequency:" & lt; & Lt; Ppi- & gt; Current Month & lt; & Lt; "MHz" & lt; & Lt; Std :: endl; Ppi ++; }} And {std :: cout & lt; & Lt; "CollapsePower information failed. Status:" & lt; & Lt; Status & lt; & Lt; Std :: endl; } Delete [] pBuffer; System ("pause"); Return status; }

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -