public void OnExecute()
{
if (System.Environment.TickCount - lastTick >= 1000)
{
fps = frameRate;
frameRate = 0;
lastTick = System.Environment.TickCount;
}
frameRate++;
delay += System.Environment.TickCount - lastTickdelay;
lastTickdelay = System.Environment.TickCount;
}