-
-
Notifications
You must be signed in to change notification settings - Fork 47
-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offset in PeriodicCallback #192
Comments
An offset makes sense. I'd be happy to accept such a contribution |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Hello, I am currently using the
PeriodicCallback
to model a periodic series of 1 and 0 values. The series of 1 and 0 do not have the same period. For instance, the period of the 1 series is 60 minutes, while the period of the 0 series is 20 minutes. Using this example, I aim to have a sequence of 1 for the first 60 minutes, followed by 0 for 20 minutes, then 1 for the next 60 minutes, 0 for the next 20 minutes and so on. I use thePeriodicCallback
to update a value within my system. However, with the current callback implementation, achieving this behavior is not straightforward because it doesn't work at the beginning of the specified time span.Describe the solution you’d like
I would like to propose adding an offset to the
PeriodicCallback
so that the first action occurs attspan[1] + offset
instead oftspan[1]
. Currently, I've implemented my ownOffsetPeriodicCallback
(essentially a modified copy ofPeriodicCallback
with an added offset parameter) in my library. However, it would be more convenient if this functionality were directly integrated into the existingPeriodicCallback
.Describe alternatives you’ve considered
Below is the code I have implemented to make this work:
Additional context
Thank you for considering this enhancement. If there are any corrections or improvements needed, please let me know.
The text was updated successfully, but these errors were encountered: