Skip to content

Make ISO 8601 Timestamp milliseconds support optional#352

Merged
matth-x merged 2 commits intomainfrom
feature/timestamp-trim-ms
Aug 6, 2024
Merged

Make ISO 8601 Timestamp milliseconds support optional#352
matth-x merged 2 commits intomainfrom
feature/timestamp-trim-ms

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
@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