-
Notifications
You must be signed in to change notification settings - Fork 69
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
Deprecate math::clock alias #600
Conversation
Recommend using std::chrono::steady_clock directly instead of this alias. Fixes #436. Signed-off-by: Steve Peters <[email protected]>
include/gz/math/Stopwatch.hh
Outdated
using clock = std::chrono::steady_clock; | ||
// This alias is now deprecated; please use std::chrono::steady_clock | ||
// directly instead. | ||
using clock GZ_DEPRECATED(8) = std::chrono::steady_clock; |
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.
windows CI doesn't like this
Stopwatch.hh(33,17): error C2062: type 'int' unexpected
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.
trying [[deprecated]]
based on https://stackoverflow.com/a/50882131
Signed-off-by: Steve Peters <[email protected]>
@@ -154,8 +155,8 @@ TEST(Stopwatch, StartStopReset) | |||
watch.Start(true); | |||
EXPECT_TRUE(watch.Running()); | |||
EXPECT_LT(watch.StopTime(), watch.StartTime()); | |||
EXPECT_NE(math::clock::duration::zero(), watch.ElapsedRunTime()); | |||
EXPECT_EQ(math::clock::duration::zero(), watch.ElapsedStopTime()); | |||
EXPECT_NE(steady_clock::duration::zero(), watch.ElapsedRunTime()); |
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.
windows failed on this line; I think it's flaky
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #600 +/- ##
=======================================
Coverage 95.97% 95.97%
=======================================
Files 147 147
Lines 10122 10123 +1
=======================================
+ Hits 9715 9716 +1
Misses 407 407 ☔ View full report in Codecov by Sentry. |
🎉 New feature
Closes #436.
Summary
Recommend using
std::chrono::steady_clock
directly instead of this alias. This should already have been removed from downstreamgz-*
packages.Test it
Compile Ionic workspace with this branch and watch for deprecation warnings.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.