Add optimization for >>1k fps scenarios
This commit is contained in:
parent
cf45d41c85
commit
95381170d8
|
@ -2375,9 +2375,20 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DateTime _lastMessageCheck = DateTime.MinValue;
|
||||||
|
|
||||||
private void CheckMessages()
|
private void CheckMessages()
|
||||||
{
|
{
|
||||||
Application.DoEvents();
|
var currentTime = DateTime.Now;
|
||||||
|
// only check window messages a maximum of once per millisecond
|
||||||
|
// this check is irrelvant for the 99% of cases where fps are <1k
|
||||||
|
// but gives a slight fps boost in those scenarios
|
||||||
|
if ((currentTime - _lastMessageCheck).Milliseconds > 0)
|
||||||
|
{
|
||||||
|
_lastMessageCheck = currentTime;
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
|
|
||||||
if (ActiveForm != null)
|
if (ActiveForm != null)
|
||||||
{
|
{
|
||||||
ScreenSaver.ResetTimerPeriodically();
|
ScreenSaver.ResetTimerPeriodically();
|
||||||
|
|
Loading…
Reference in New Issue