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

feat: support %f for us and %q for ms in #format {%t}, also in #log timestamp #223

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

Conversation

dzpao
Copy link
Contributor

@dzpao dzpao commented Apr 29, 2024

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.

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.

None yet

1 participant