New answers tagged

1 vote

How to efficiently code a long duration timer

Your posted code will never fail. See http://gammon.com.au/millis Let me put it this way. Does your clock "fail" at midnight? Subtracting the start time from time now always works (even ...
user avatar
  • 35k
2 votes

How to efficiently code a long duration timer

There are various notions of efficiency, depending on what resource you want to optimize for. For a battery-powered project, the most relevant is likely to be energy-efficiency. Then, your code may ...
user avatar
  • 35.5k
4 votes
Accepted

How to efficiently code a long duration timer

Should I still be using millis() or is there a more efficient way to create a timer which tracks these longer time periods? For longer time periods you really should use an RTC. You will get much ...
user avatar
  • 101k

Top 50 recent answers are included