should probably call timeBeginPeriod at some point

This commit is contained in:
zeromus 2011-08-27 18:00:14 +00:00
parent 382ae901e7
commit 401ca0e982
1 changed files with 7 additions and 0 deletions

View File

@ -123,12 +123,19 @@ namespace BizHawk.MultiClient
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool QueryPerformanceFrequency(out ulong frequency);
[DllImport("winmm.dll", EntryPoint = "timeEndPeriod")]
static extern uint timeEndPeriod(uint uMilliseconds);
[DllImport("winmm.dll", EntryPoint = "timeBeginPeriod")]
static extern uint timeBeginPeriod(uint uMilliseconds);
static int tmethod;
static ulong afsfreq;
static ulong tfreq;
static Throttle()
{
timeBeginPeriod(1);
tmethod = 0;
if (QueryPerformanceFrequency(out afsfreq))
tmethod = 1;