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

Use std::chrono::duration types consistently #525

Open
CodingCanuck opened this issue Aug 4, 2022 · 0 comments
Open

Use std::chrono::duration types consistently #525

CodingCanuck opened this issue Aug 4, 2022 · 0 comments

Comments

@CodingCanuck
Copy link
Contributor

::eventuals::Timer() takes a std::chrono::milliseconds:

[[nodiscard]] inline auto Timer(const std::chrono::milliseconds& milliseconds) {

But it's just a pass-through to Clock().Timer(), which instead takes a std::chrono::nanoseconds:

[[nodiscard]] inline auto EventLoop::Clock::Timer(
std::chrono::nanoseconds nanoseconds) {

We should standardize on one type type for timers.

We probably should also pass std::chrono::duration types by value, not const&: https://stackoverflow.com/questions/37918168/pass-stdchronoduration-by-value-or-by-reference-to-const since they're essentially backed by ~ints by default: https://en.cppreference.com/w/cpp/chrono/duration

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

No branches or pull requests

1 participant