feat: support %f for us and %q for ms in #format {%t}, also in #log timestamp #223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tt's time string formatting methods currently only support those already available in POSIX strftime, which do not include milliseconds and microseconds. This often feels a bit insufficient when printing logs for fine-grained analysis. For this reason I have added support for milliseconds and microseconds.
The %f for microseconds is consistent with Python. Using %q for milliseconds is a no-brainer because I looked at the documentation for strftime and found that almost all the letters (both case and lowercase) were already taken, except %q, which I chose.
Considering that tt++ scripts are less likely to interoperate with other languages, and that timestamping isn't really a high-frequency feature to change, I don't think it should be too much of a problem.
Or if you have a better suggestion, please let me know.