Skip to content

Is there a better way to convert quantity time to chrono nanoseconds? #268

Closed Answered by JohelEGP
ManuelMeraz asked this question in Q&A
Discussion options

You must be logged in to vote
  ...
  spin_wait(units::isq::Frequency auto frequency)
  {
    m_wait_time = std::chrono::nanoseconds(units::quantity_cast<units::isq::si::nanosecond>(std::int64_t{1} / frequency).number());
  }

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@chiphogg
Comment options

@chiphogg
Comment options

@mpusz
Comment options

@mpusz
Comment options

@chiphogg
Comment options

Answer selected by ManuelMeraz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants