Reputation: 4611
I have to write a data logger application. I want it to insert data into the database every minute (seconds time must be zero). how can I do this? Can I use delegates for inserting? If yes how can I do this?
Upvotes: 1
Views: 754
Reputation: 14781
Check the value of the DateTime.Now.Minute
and DateTime.Now.Second
to get the value of the current time.
Handle the Timer class Elapsed event to execute your code in an interval basis.
Upvotes: 1
Reputation: 1039190
You could use a Timer to execute recurring events at regular intervals.
Upvotes: 1