Hi!
I use C# 4.0 to build a windows form application.
I have a Windows Forms Timer that should tick every second. In every tick I do some work (get GPS position, update a map, save to a local DB etc). It takes about 0.09 sec to execute. The save to the local DB is done async to release the GUI thread faster but the other code is executed on the GUI thread (need to for updating the GUI)
Some time the tick is not fired constantly, it can be several seconds between (I guess the GUI thread is busy in some way).
How can I rewrite so that there always will be a tick on time, is it possible? The program runs on machine with a single processor. Most of the time the CPU usage is not very high.
Would there be any meaning to switch to a System.Threading Timer to get more accuracy? I do need to be on the GUI thread most of the time during the Timer execution.
Regards
Henrik