I need to record the time taken by a task and it's been sugguested I use windows performance counters.
I need to record the time taken to solve a given MathProblem. The Solve methods first line will start the StopWatch and the last line will Stop it.
When I record the time taken to solve the problem I need to record the time along with the ProblemId (a string).
Can performance counters be use the record data like this? Will the perfmon graph plot the times along with a idenitifer? so when I click or hover over the graph point it will show the ProblemID?
Thanks in advance
public class MathProblem
{
public string ProblemID;
public void Solve()
{
StopWatch sw = StopWatch.StartNew();
sw.Stop();
//Log to performance counter with ProblemID
}
}