2010-11-18 6 views
1

単語を聞いた後にユーザーがどれくらい速くクリック(応答)するかを測定するアプリケーション[net/wpf/c#]を作成しています。それは聴覚処理速度試験(PST)と呼ばれ、人間の平均速度は約70-140msです。生成されるイベントの精度のアイデアを得るために、私は次のように書いています。 マウスクリック間隔のリアルタイム測定

public partial class MainWindow : Window 
{ 
    System.Diagnostics.Stopwatch w = new System.Diagnostics.Stopwatch(); 

    public MainWindow() { InitializeComponent(); } 

    private void textBlock1_PreviewMouseDown (object sender, MouseButtonEventArgs e) 
    { 
     e.Handled = true; 
     w.Stop(); 
     System.Diagnostics.Debug.WriteLine(w.ElapsedMilliseconds); 
     w.Reset(); w.Start(); 
    } 

    private void Grid_KeyDown (object sender, KeyEventArgs e) 
    { 
     e.Handled = true; 
     w.Stop(); 
     System.Diagnostics.Debug.WriteLine(w.ElapsedMilliseconds); 
     w.Reset(); w.Start(); 
    } 
} 

private void Application_Startup (object sender, StartupEventArgs e) 
{ 
    Process thisProc = Process.GetCurrentProcess(); 
    thisProc.PriorityClass = ProcessPriorityClass.RealTime; 
    ProcessThreadCollection myThreads = thisProc.Threads; 

    foreach (ProcessThread pt in myThreads) { 
     pt.PriorityLevel = ThreadPriorityLevel.TimeCritical; 
    } 
} 

私がクリックできる最速

は約100msであり、かつ押さキーボードのキーを保つならば、ダウン私は、応答時間の30msのに取り掛かります。私はそれをもっと速くする方法はありますか? TIA

+0

PS:私のkeyboad繰り返し間隔が最高に設定されています。 – user109134

答えて

1

DirectInputを使用してマウスをポーリングしたことがありますか?

関連する問題