static void TestWaitEvent()
{
const int n = 1000000;
manualResetEvent.Reset();
Stopwatch stopwatch = Stopwatch.StartNew();
int j = 0;
for (int i = 0; i < n; i++)
{
manualResetEvent.WaitOne( 0 );
}
stopwatch.Stop();
WriteTime("Wait Event", n, stopwatch.ElapsedTicks);
}