Main Site Documentation

Elapsed Time is usec or msec


#1

How does one get elapsed time?

For example to time sections of code?


#2

Sorry, should have read more. I used button pressed to have elapsed time.

      
 void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            TimeSpan elapsed = DateTime.Now - start;
            double dt = (double)elapsed.Seconds + ((double)elapsed.Milliseconds)/1000.0;
            display.SimpleGraphics.DisplayText("Elapsed = "+dt.ToString(), MyFont, Colors.White, 0, yloc);
            yloc += (uint)MyFont.Height;
            if (yloc >= 20 * (uint)MyFont.Height)
            {
                yloc = 0;
                display.SimpleGraphics.Clear();
            }
            button.ToggleLED();
        }


#3

http://msdn.microsoft.com/en-us/library/ee432845.aspx is the definitive reference for datetime.