Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WinForm
Hello,
 
I have a winform system showing photos, the system measure the elapsed time between showing the photo until the user pressed any key button on the keyboard with a stopwatch.
 
I saved the time in a
Dictionary<image, long>
in such a way that for each photo i have the response time(saved in miliseconds) from the user.
 
How do i verify that the times that the user pressed is the real times saved in the dictionary?
 
Is there any tool in VS2012 or other, to help me Verify it?
 
Thanks.
Posted 17-Apr-13 22:58pm
Comments
Kenneth Haugland at 18-Apr-13 4:00am
   
Depends on how accurqate you need the timer to be. If you want millisecound accuracy I think youll have to resolve the issue with external hardware.
RoyDoron at 18-Apr-13 4:02am
   
I just want to know if the times saved are in the normal interval..
I'm taking under consideration other apps on the cpu.
 
I dont want to use external hardware, just vs tools or other programs.. is there any?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Most accurate method to time interval between event using the same computer is the class System.Diagnostics.Stopwatch:
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx[^].
 
Pay attention for the static fields IsHighResolution and Frequency, to see what resolution do you really have. Normally, on a Windows platform, it is very good.
 
—SA
  Permalink  
Comments
Espen Harlinn at 25-May-13 20:25pm
   
5'ed!
Sergey Alexandrovich Kryukov at 25-May-13 20:39pm
   
Thank you, Espen.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

It takes about 20 ms before the brain can start processing the picture, and then it has to make a desicion, before telling the hand to press a key.
 
Unless your program tries to quantify Nerve conduction velocity[^] - a regular PC should do well enough under a normal load.
 

Best regards
Espen Harlinn
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 11-Jun-13 19:47pm
   
Great point, a 5.
—SA
Espen Harlinn at 12-Jun-13 15:45pm
   
Thank you, Sergey :-D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 25 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100