ropg / ezTime

ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
MIT License
327 stars 92 forks source link

Library without interruptions suggestion #174

Closed Sinix10 closed 2 months ago

Sinix10 commented 8 months ago

Hello, This is not an issue, but more of a request or suggestion, since there is no "request" or "suggestion" button in github, only an "issue" button. They should add those buttons, since it has its own purpose.

When I use the word interruption, I don´t mean the "interrupt()" function only. I meant the "delay()", "while()","interrupt()" or any other function that stops the MCU for a certain time and blocks it from running the entire program.

I notice your library codes have some interruptions, like "delay()" and "while()".

Hypothetical Scenario In a program where there is no room for any interruption, meaning it must always to be running, any interruption will compromise the rest of the program from being executed.

My Scenario For exemple, my program needs to run flawlessly without any interruptions or it will fail its ultimate purpose. Also it must be fast when initializes, because time is crucial in my scenario. I´m building a Controller for my wind turbine, where it senses the voltage from the turbine and activates the SSR (the dump load is connected to the SSR) as needed based on the voltage that it senses. It must be fast responsive, if the voltage reach a certain value, it will activate the SSR and vice versa. If there is an interruption somewhere in the program when a wind gust strong enough to generate an over-voltage condition is incoming, it will damage the batteries and the full system will be compromised. This is the reason that it must be reading all the time. And also free to do other stuff. The program that I´m building does not have any "delay()" or "while" in it, it only has "if" as a control method counting time, this way the entire program never stops to do other things, for exemple listening to webpage requests, sensing voltage (this one is a Paramount point, there must be nothing delaying this from happening), clock counting and other things internally simultaneously.

I think the functionality of having a program without any interruptions is very practical and useful for many projects, if not for all projects because it will never compromise the program on which it will be implemented.

I have tested other NTP codes and they suck, if the network goes down the clock keeps showing the same time until the network comes up again. Yours is the best. It even keeps counting time if the network goes down, which is the most useful feature and a basic one that any clock should have to be honest. You did a great job, and for that I give you KUDOS.

Since this code is built by you, you know it better than anyone, therefore I came to ask you, is there a chance that you can convert your code into a free interruptions clean code?

Best Regards

Sinix10 commented 7 months ago

hello?

Sinix10 commented 2 months ago

Closing...