BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

The difference between SimpleTimer and BlynkTimer

Pete, though it is an off topic but I have a question here. What is the difference between SimpleTimer & BlynkTimer? Why people add an additional header file instead of using BlynkTimer? What is the benefit of using SimpleTimer?

I moved your question into its own topic as is the prefered method.

Doc - http://docs.blynk.cc/#blynk-firmware-blynktimer

image

Basically , there is almost no difference… it is just now imbedded with a few “enhancements” made like allowing more timers (16) per referenced instance… and a few other internals that are mentioned in other topics… if I can find then I will link them here…

image

2 Likes

Thanks buddy. So, it is good practice to use BlynkTimer in blynk sketch.

So, there is a problem here in ur Important section. Thus, SimpleTimer is far better & more preferable for this scenario.

No… that notice implies the developers “fixed” (in BlynkTimer) an “issue” that is enherant in SimpleTimer.

However, it is an “issue” that may or may not affect non-Blynk uses as that library has been around a loooong time.

1 Like

Then which one should I used that will be perfect for any kind of condition.

BlynkTimer for all Blynk sketches, since it is built into the Blynk Library… It will work even when not connected to the server, if the rest of the sketch is programmed properly.

SimpleTimer for all other non-Blynk sketches… since, well, you have to use it, or some other form of timer library :stuck_out_tongue:

2 Likes

One more question. Can I use 20millisecond just like timer.setInterval(20L, myAnalogFunc);
Is that okay? Or it will create problem in the blynk server? What is the minimum calling time?

There is no problem with calling some function with milliseconds frequency (this depends on complexity of code naturally). But if such a timer will be used to send any data to Blynk server (i.e. virtualwrite) the serwer will disconnect due to flooding.

1 Like