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

Global: Adds units to time values #25824

Closed

Conversation

muramura
Copy link
Contributor

@muramura muramura commented Dec 23, 2023

Elapsed time includes seconds, milliseconds, and microseconds.
The elapsed time determination comment states that 3000 is 3 seconds.
I add time units to the time value.
By adding the unit to the time value, it is easy to recognize that it is seconds, milliseconds, or microseconds.

I plan to do a PR on the library in the future.

Screenshot from 2023-12-23 09-51-56

test program
Screenshot from 2023-12-23 09-52-04

Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR but I think it would be better to instead add _ms to the end of some of the variables like "loiter_time" (e.g. make it "loiter_time_ms").

@peterbarker
Copy link
Contributor

Sorry, but I don't think improves the readability.

I mean, great hack, I didn't even realise that was possible, but we do try to keep our use of the language to things everyone will be relatively familiar withg. The proposed use of this cleverness would be widespread, meaning it might surprise a lot of people.

Sorry, closing this one.

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.

3 participants