void gameMemory_OnSetTickRate(object sender, SetTickRateEventArgs e) { // if we keep the ticks from the previous session, a tick rate change may happen due to // different game versions, causing the existing ticks to produce the wrong time // so store this time and reset the total tick count Debug.WriteLine("tickrate " + e.IntervalPerTick); Debug.WriteLine($"add to cumulative time: {GameTime.Ticks - _cumulativeTime}"); _cumulativeTime += GameTime.Ticks - _cumulativeTime; _totalTicks = 0; _intervalPerTick = e.IntervalPerTick; }
void gameMemory_OnSetTickRate(object sender, SetTickRateEventArgs e) { Debug.WriteLine("tickrate " + e.IntervalPerTick); _intervalPerTick = e.IntervalPerTick; }