How to get CPU Usage of a Silverlight application from code?
I need to build a widget which would show (and monitor) CPU usage by a Silverlight instance (the control will be part of the silverlight application and would track the running instance). I could not find Process/PerformanceMonitor class in Silverlight.
Is there any existing API or some way to do this?
Edit 1) Same question being answered fo开发者_开发技巧r non-Silverlight: How to get the CPU Usage in C#?
Thanks for your interest.
You should be about to use System.Windows.Analytics.AverageProcessorLoad
to get the CPU load.
http://msdn.microsoft.com/en-us/library/system.windows.analytics.averageprocessorload%28VS.95%29.aspx
Not sure if OOB or Elevated Trust is required for this to work.
精彩评论