how to know, how much time take method in C#
for example, i have label1 and method
public int MakeSome(int a, int b)
{
for (int i = 0; i < a; i++)
{
for (int j = 0; j < b; j++)
{
// some operation
}
}
return returnIntValue;
}
know, how to know how many milliseconds take MakeSome method, and write value in label1.
thanks
Use the Stopwatch class from the System.Diagnostics namespace.