To run a function every second use the DispatcherTimer Class https://docs.microsoft.com/en-us/dotnet/api/system.windows.threading.dispatchertimer?redirectedfrom=MSDN&view=netframework-4.8 DispatcherTimer will tick evey second calling dispatcherTimer_Tick. You can set the interval with a timespan