Q:

how to recalculate something ~once per second?

I need to do some pretty fast recalculation ~every second.
What is the best way to do that? Is using dedicated thread and Thread.Sleep is ok?
        Task.Factory.StartNew(() => 
        {
            while (true)
            {
                RecalculateState();
                Thread.Sleep(1000);
            }
        }, TaskCreationOptions.LongRunning);

A:

That would work - but another alternative would be to use a timer, e.g. System.Threading.Timer or System.Timers.Timer.
You should think about:

What do you want to happen if it takes more than a second to recalculatte state?
Is your RecalculateState method entirely safe to be called from arbitrary threads?

