-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add visualizer for std::chrono::system_clock::time_point
#5005
Add visualizer for std::chrono::system_clock::time_point
#5005
Conversation
|
fb061d7
to
c4bac42
Compare
<Intrinsic Name="era" Expression="(z() >= 0 ? z() : z() - 146096) / 146097"/> | ||
<Intrinsic Name="doe" Expression="(unsigned)(z() - era() * 146097)"/> | ||
<Intrinsic Name="yoe" Expression="(doe() - doe()/1460 + doe()/36524 - doe()/146096) / 365"/> | ||
<Intrinsic Name="doy" Expression="doe() - (365*yoe() + yoe()/4 - yoe()/100)"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change requested: Stylistically, I would have put spaces around all binary operators, as we do in product code (enforced by clang-format). But I can see an argument for the choices here, and I'm not picky enough about visualizer syntax for it to be worth resetting testing.
Thanks, this is awesome! 😻 It didn't matter for this PR, but for the future - we recommend against force-pushing after review has begun, as GitHub makes it more difficult to see what's incrementally changed. (Force-pushing is okay if there's a solid reason for it, like reorganizing commits to make them comprehensible, or if review hasn't started yet.) |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for this significant improvement - and congratulations on your first microsoft/STL commit! 🎉 😻 🚀 I've filed a followup issue because we need to "triple-mirror" this change into the VS repo in order for it to actually take effect in the IDE. |
Adds a visualizer for
std::chrono::system_clock::time_point
. To compute the date representation, it uses the same algorithm as_Civil_from_days
(with the same "variables" as https://howardhinnant.github.io/date_algorithms.html#civil_from_days).The time is displayed as hh:mm:ss.ssssss. Additionally, the visualizer shows
ns/100
(the actual value of the time-point),us
,ms
, ands
.Unfortunately, the format specifiers don't provide a way of formatting numbers with padding, so they're formatted "manually" (e.g. a 2-digit
v
is formatted as{v/10}{v%10}
).See also: #314