locked
how to measure time between 2 button press ? (winCE + C#) RRS feed

  • Question

  • hi

    i need to measure time between 2 button press

    in Windows-CE C# 

    how do do it ?

    thank's in advance
    Wednesday, May 26, 2010 5:56 PM

Answers

  • To measure time between two events you can use this formula:

    timeBetweenEvents = timeAtSecondEvent - timeAtFirstEvent

    Where:

    timeBetweenEvents - desired time between bvents

    timeAtSecondEvent - time value obtained at second event

    timeAtFirstEvent - time value obtained at first event

    You can use DateTime.Now to obtain current time, then store timeAtFirstEvent in a variable so you can use the formula.

    Alternatively use System.Environment.TickCount for better precision.

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, May 26, 2010 6:59 PM