Получение system-clock-change-tick в C#

Я экстенсивно использовал Bugzilla (значение по умолчанию для проектов на работе), но Богомол получает мой голос за легкую установку и использование.

5
задан Willem Van Onsem 25 December 2015 в 02:57
поделиться

2 ответа

If your question is: "How do I execute a delegate every full second/minute/hour?"

For minute and hour intervals, you could do something like shown in my answer in this SO question:

This should be fairly accurate, but won't be exact to the millisecond.

For second intervals, I'd go with a Timer with a simple 1-second-interval. From a user's perspective I think there's not a lot of difference if the action executes at xx:xx:xx.000 or at xx:xx:xx.350.

7
ответ дан 18 December 2019 в 10:46
поделиться

You can subscribe to SystemEvents.TimeChanged. This fires when the system clock is altered.

6
ответ дан 18 December 2019 в 10:46
поделиться
Другие вопросы по тегам:

Похожие вопросы: