The class Stopwatch from the namespace System.Diagnostics allows time to stop exactly:
Stopwatch sw = new Stopwatch ();
sw.Start ();
/ * do your work * /
sw.Stop ();
this . labelTime.Text =
"ElapsedTicks" sw.ElapsedTicks.ToString + () +
"\\ nElapsedMilliseconds " sw.ElapsedMilliseconds.ToString + () +
" \\ nElapsed (timespan): " + sw.Elapsed.ToString ();
0 comments:
Post a Comment