Skip to content
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

Eliminate need for multiple calls to nondeterministic millis() when getting individual day/time components #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LeonPoon
Copy link

@LeonPoon LeonPoon commented May 19, 2021

Also eliminated some dup calc code between getHours/Minutes/Seconds and getFormattedTime.

Fully backwards compatible.

@CLAassistant
Copy link

CLAassistant commented May 19, 2021

CLA assistant check
All committers have signed the CLA.

@LeonPoon LeonPoon changed the title Eliminate need for multiple calls to nondeterministic millis() when getFormattedTime() Eliminate need for multiple calls to nondeterministic millis() when getting individual day/time components May 19, 2021
@LeonPoon
Copy link
Author

LeonPoon commented Jun 2, 2021

Would appreciate feedback, or a merge please.

I encountered one instance when the getHours and getMinutes don't provide consistent results, because of each of these make calls to millis() on their own, which might not return the same value. It was 8:59++ and getHours() returned 8 but getMinutes returned 0 and my datalogger recorded time as 8:00 when it was actually closer to 9:00.

With this patch, allows me to provide same millis input to gethours/minutes rather than having these get functions call their own millis().

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants