Edit: I'm NOT asking for a way to implement a profiling library, I'm asking if there's one (preferably free) out there.
Although there are a lot of commercial and free profilers for the .NET platform they all analyses (better or worse) your application code in a way that let's you see what method call or even line is consuming a lot of resource.
While that might be useful in a lot of quick optimization situations I was interested in a more direct "library" approach. Basically I have in mind something that lets me define scenarios with checkpoints so that I can profile and compare between versions any two given scenarios.
I want to be able to define something like:
Mon.StartScenario("ClientReportsTime");
// Get All clients
//...
Mon.CheckPoint(); // You should be able to see memory ussage
//and time taken to reach this point.
// Extract information
//..
Mon.CheckPoint();
// Finished!!
Mon.StopScenario("ClientReportsTime");
So that an scenario has a given time that can be precisely identified. It's a relatively simple piece of functionality and I was about to implement it as a library when I thought that might be out there somewhere. Do you know about some existing library like that?