Cromwell Haus
A place for the Cromwell family to gather, share pictures,
and discuss anything under the sun.

PerformanceHelper.cs


posted by cromwellryan
04-19-2007

Downloads: 188
File size: 4.8kB
Views: 531
PerformanceHelper.cs
Filed under: ,

Provides easy performance counter integration for monitoring blocks of code for Operations/sec and Average Time/Operation.  Use in the following pattern:

[UPDATE (10-26-2007): You can now specify the output options for Console, Debug, and/or Perfmon.  Doesn't give you all the Perfmon metrics, but it's useful.]

using(new PerformanceHelper(CATEGORY, "<BlockInstanceName>") )

{

    //...

}

 /* OR */

using(new PerformanceHelper(CATEGORY, "<BlockInstanceName>", OutputOptions.Debug | OutputOptions.Perfmon) )

{

    //...

}

Add a Comment

(required)
(optional)
(required) 
Powered by Community Server (Non-Commercial Edition), by Telligent Systems