CPU usage


Taskmanager displays the usage percentage of the CPUs. How can I get the same info from my code?

Regards, GD
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Have a look at the component on this page at the top: http://www.torry.net/systeminfo.htm

Geoff M.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
This will sort your problem :)

    procedure Timer1Timer(Sender: TObject);
    procedure Button1Click(Sender: TObject);



{$R *.dfm}
  TProcessorTimeInfo = record
    IdleTime: int64;
    KernelTime: int64;
    UserTime: int64;
    DpcTime: int64;

function NtQuerySystemInformation(si_class: cardinal; si: pointer; si_length: cardinal; ret_length:cardinal):cardinal; stdcall; external 'ntdll.dll';

procedure TForm1.Timer1Timer(Sender: TObject);
  buf:array[0..299999] of char;
  //pi: ^TProcessInfo;
  ti: ^TProcessorTimeInfo;
  NtQuerySystemInformation(8, @buf, 300000, 0);

  StatusBar1.Panels[0].Text:='CPU: '+inttostr(i)+'%';

Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

TO Shinez

not STEAL!

*** off topic comment removed by Netminder, EE Admin ***
TO Shinez

brought by you code from my example.
this example is not in knowledge.
he is written by me
*** off topic comment removed by Netminder, EE Admin ***
TO Shinez

using someone else work indicate this.

copyrights did not canceal
*** off topic comment removed by Netminder, EE Admin ***
To talk to cretins, to not respect myself . Conversation is finished.
kool :)
gooddayAuthor Commented:

I appreciate your trying to help.

I think any work done by a programmer that creates value is worth for money. It is a very unselfish and generous act to share some results of your own creativity with other people.
No one should judge you, or tell a singe bad thing about you for NOT sharing the result of your own work, but you really have to understand, that once you share it, you donate it to everybody else. It becomes public property. If you do not limit how it can be used and copied then everyone is allowed to use it for any purpose, and use it, as his own code. Even share it with other people.

ALL RESPECTS will always belong to you for being able to create, and for sharing your code. But most people will probably never say thank you to you, because they will never know the original creator.

I think you also have to understand, that at Experts-Exchange the person who first provides the information is prized by points, not the original source. This place is about information sharing. The one who does it faster and better takes the prize.

I personally highly appreciate everyone who is willing and able to help, and I try to give some points to everybody who provides any useful information.

In this particular case, your help was very useful to me, the points go to you.

Many thanks, GD.
gooddayAuthor Commented:

Thanks for trying to help.

Please give some time to 13_th to understand how things work here .... :)

Best Regards, GD
thats kool :) we all here 2 help each other.
to goodday

not against use of my code basically. I think not correct use of my work in this case Shinez
gooddayAuthor Commented:

One more thing: I think it is fair and nice that  you try to help me to undestand 13_th's code better. Though the source he/she provided, was enough for me. It was a complete answer to my question, thats why I gave the points to him/her.

Good Luck, GD  
gooddayAuthor Commented:

As I understand Shinez did not mean to provide your code as if it was his/her own. He/She must have taken a look at the source and copied to EE the part of it, which actually holds the answer. Just to highlight the important parts. It was no question, that the real work was done by you. Shinez only tried to save some time to me by doing this. Which is also very nice from him/her. :)

I think you both simply misunderstood each others point of view.

I appreciate both of you for being here on a Sunday afternoon.

Best Regards, GD.
*** off topic comment removed by Netminder, EE Admin ***
gooddayAuthor Commented:

" .. blue sky and everything.. " - :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.