[DllImport("winmm.dll", EntryPoint="timeBeginPeriod")]
public static extern uint MM_BeginPeriod(uint uMilliseconds);
Declare Function timeBeginPeriod Lib "winmm.dll" (ByVal uPeriod As Integer) As Integer
None.
Also see TimeGetTime (MM_GetTime) and TimeEndPeriod (MM_EndPeriod)
Please add some!
static void Main(string[] args)
{
StreamWriter oWriter = null;
MM_BeginPeriod(1); // set timer resolution to 1ms => freq=1000Hz
try
{
oWriter = new StreamWriter(@"ticks.txt");
// tickcount has resolution of 16.5ms, mmtime has 1ms
for(int nLoop = 0; nLoop < 100000; nLoop++)
oWriter.WriteLine("{0}: TickCount={1}, MMTime={2}", nLoop, Environment.TickCount, MM_GetTime());
}
catch(IOException oException)
{
Console.WriteLine(oException.Message);
}
finally
{
if(oWriter != null)
oWriter.Close();
}
MM_EndPeriod(1);
}
Do you know one? Please contribute it!