I am working on a DirectPlay application and it will include D3D graphics at a later stage. The question I have is in regards to the timer system, What do I use?
At the moment I need a timer that will be used on the server and client that will poll different functions and provide actions on these functions. Do I use the normal system timer in the threading name spaces, or I found some examples of Timers that have been used in Dx apps, ie the one from the samples in the sd, or one that uses the following api calls,
/// <summary>
/// The current system ticks (count).
/// </summary>
/// <param name="lpPerformanceCount">Current performance count of the system.</param>
/// <returns>False on failure.</returns>
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceCounter(out long lpPerformanceCount);
/// <summary>
/// Ticks per second (frequency) that the high performance counter performs.
/// </summary>
/// <param name="lpFrequency">Frequency the higher performance counter performs.</param>
/// <returns>False if the high performance counter is not supported.</returns>
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceFrequency(out long lpFrequency);
At the moment I need a timer that will be used on the server and client that will poll different functions and provide actions on these functions. Do I use the normal system timer in the threading name spaces, or I found some examples of Timers that have been used in Dx apps, ie the one from the samples in the sd, or one that uses the following api calls,
/// <summary>
/// The current system ticks (count).
/// </summary>
/// <param name="lpPerformanceCount">Current performance count of the system.</param>
/// <returns>False on failure.</returns>
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceCounter(out long lpPerformanceCount);
/// <summary>
/// Ticks per second (frequency) that the high performance counter performs.
/// </summary>
/// <param name="lpFrequency">Frequency the higher performance counter performs.</param>
/// <returns>False if the high performance counter is not supported.</returns>
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceFrequency(out long lpFrequency);