أعمل على برنامج (بلغة ++C كما يوضح موضوع المنتدى) حيث أحتاج إلى معرفة الـ CPU Usage (الذي يظهر في الـ Task Manager) لقد بحثت في الـ MSDN و وجدت إجراءات جاهزة من أجل ذلك ولكن في VB و C# و C++ .Net و ليس في الـ Native ++C
Do you mean ISO C++ by native C++? Actually I don’t know anything about this in pure C++ since this always depends on what type of system you are using. Check out RegQueryValueEx for now, I’m assuming you use Windows because you mentioned MSDN. As for how to use it I’m sorry because I never used did. But I believe that you must record a number of CPU Usage values over an interval of time and then calculate the average.
> Check out RegQueryValueEx for now, I don’t get it, what is the relationship between CPU usage and registry entries??!!!!
> I’m assuming you use Windows because you mentioned MSDN. Just to clear things up... who said that MSDN is specific to Windows?
> Check the following link : http://www.geocities.com/SiliconValley/Horizon/ > 2691/files.htm and take a look at the Memory Stat code. It is really > complicated so I’ll try to dig more about it later Thanks I found what I wanted (along with other cool stuff)…
التعليق على مشاركة Abdo Haji-Ali في July 13, 2005 23:38 :
>> I’m assuming you use Windows because > you mentioned MSDN. > Just to clear things up... who > said that MSDN is specific to Windows?
Well, MSDN is from MS, and Windows is from MS... So MSDN is for Windows ;) Just kidding, but I think we all agree that 90% of MSDN is about technology from MS for Windows (except for the programming languages references I guess?)
> Thanks I found what I wanted (along > with other cool stuff)…
Well? Would you be kind and post the routine that does it?
I thought the link is enough... Anyway I can't even if I want to; the function responsible for this task is very complicated calling other functions and using external variables So you'll just have to follow the link, download the "Memory Stat" source and look for GetCPUUsage() (or something like that)