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

Make ISO 8601 Timestamp milliseconds support optional #352

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

matth-x
Copy link
Owner

@matth-x matth-x commented Aug 6, 2024

Adds a build switch MO_ENABLE_TIMESTAMP_MILLISECONDS to enable / disable the millisecond support of the Timestamp class.

To enable, set MO_ENABLE_TIMESTAMP_MILLISECONDS=1 (disabled by default). To keep the old behavior, disable the switch explicitly in the build settings.

If disabled, the milliseconds fraction of incoming ISO 8601 timestamps will be ignored. Outgoing ISO 8601 strings will omit the milliseconds.

This change saves a few bytes per Timestamp, with the class size being slightly reduced from 24B to 20B. While this ~17% saving is not too significant, it nevertheless fits the design philosophy of microcontroller optimization.

@matth-x matth-x merged commit d6840ef into main Aug 6, 2024
5 checks passed
@matth-x matth-x deleted the feature/timestamp-trim-ms branch August 6, 2024 11:00
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.

1 participant