private void SetTimerFrequency(int frequency)
{
if (_timer == null)
{
_timerPeriod = frequency;
_timer = new Timer(state =>
{
Render();
}, null, 1, _timerPeriod);
}
else
{
if (_timerPeriod != Face.UpdateSpeed)
{
_timerPeriod = Face.UpdateSpeed;
_timer.Change(1, _timerPeriod);
}
}
}