M
mp
I was thinking of looking at how long certain functions took in a program to
see if there were areas to optimize.
so i considered creating two objects
FunctionTimer, and ProgramTimer
then in each sub/function in the program do something like...
private void SomeFunction()
{
FunctionTimer ft = New FunctionTimer("SomeFunction");
.....code...
ft.TimeOut();
//then somehow add it to a list of all the function times for this program
run
GlobalProgramTimer.AddFunctionTimer(ft);
}
my thoughts were FunctionTimer could use a stopwatch to time the process and
store the name of function and time of running
then the programTimer could store/increment the various functions' times in
maybe a sortedDictionary or somesuch???
any thoughts/comments on either the idea or the implementation...
or is there something built in to c# that already does this?
tanks
mark
see if there were areas to optimize.
so i considered creating two objects
FunctionTimer, and ProgramTimer
then in each sub/function in the program do something like...
private void SomeFunction()
{
FunctionTimer ft = New FunctionTimer("SomeFunction");
.....code...
ft.TimeOut();
//then somehow add it to a list of all the function times for this program
run
GlobalProgramTimer.AddFunctionTimer(ft);
}
my thoughts were FunctionTimer could use a stopwatch to time the process and
store the name of function and time of running
then the programTimer could store/increment the various functions' times in
maybe a sortedDictionary or somesuch???
any thoughts/comments on either the idea or the implementation...
or is there something built in to c# that already does this?
tanks
mark