Add visualizer for std::chrono::system_clock::time_point#5005
Add visualizer for std::chrono::system_clock::time_point#5005StephanTLavavej merged 1 commit intomicrosoft:mainfrom
std::chrono::system_clock::time_point#5005Conversation
|
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.
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
vis formatted as{v/10}{v%10}).See also: #314