Go Down

Topic: Purpose of millis() timer (Read 9555 times) previous topic - next topic

JChristensen


So true. Just imagine how big the arduino world might have become if it wasn't for that darn millis() roll-over problem.  :D


And how much smaller the forum would be.  A lot of us would probably have to find honest work ;)

nickgammon

millis() is a tool. It can be misused. So can micros(), delay() and any other damn thing.

I did a page about the roll-over issue:

http://www.gammon.com.au/millis

No matter what you do, people will use it wrongly, or not even bother reading the documentation. Already we are answering a thread today where someone is doing lengthy calculations, and serial prints, inside an interrupt routine.

If you got rid of millis() people would try to use micros() and complain that it stopped working after 70 minutes. You can't win. You can only try to educate. This is one consequence of being on a forum for a platform aimed at beginners.

millis() and delay() are great for getting people started. Then after a while, they get misused and users have to ask here how to fix that. Maybe if we could edit the documentation we could improve it a bit.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

3dprinter


millis() is a tool. It can be misused. So can micros(), delay() and any other damn thing.
Indeed

And interrupts, in particular interrupts.  :smiley-roll-blue:

Quote
Maybe if we could edit the documentation we could improve it a bit.
Pigs might fly....  I believe the issue on the documentation errors/updates moderator-sanctioned has been aired before.

nickgammon

Perhaps I should have put "if" into bold. Like this:

Maybe if we could edit the documentation we could improve it a bit.

That was a hint for the site owners. :)

At present you can do it, sort of. Submit a bug report:

https://github.com/arduino/Arduino/issues

Wait about six months, and then someone authorized makes a change.

Maybe they need to control the documentation so that changes can appear in other languages simultaneously. That might be the reason.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

SirNickity

Maybe they need to control the documentation so that changes can appear in other languages simultaneously. That might be the reason.


Nahh... pretty sure all the docs and examples are in C++.

nickgammon

I meant like French, German, Swahili, that sort of thing.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

SirNickity

Yeah I know.  Just yanking your chain.  XD

TomGeorge

Hi, put the documentation in Wikipedia,  lol, that way it can be updated anytime by anyone. :)

Tom... :)
Sorry being sarcastic.
Everything runs on smoke, let the smoke out, it stops running....

Go Up