Monday, January 21, 2008

Fondant Bootie Pattern

Dot Net (C #): Duration identify with Stop Watch

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