Manish Basantani
Manish Basantani

Reputation: 17509

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 for non-Silverlight: How to get the CPU Usage in C#?

Thanks for your interest.

Upvotes: 1

Views: 565

Answers (1)

Ryan Alford
Ryan Alford

Reputation: 7594

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.

Upvotes: 1

Related Questions