Utility timestamp_ns() fix (#175)
* Update lib/common/utility.* - fix timestamp_ns() * Update samples/**/CMakeLists.txt - fail test if exception thrown * source formatting (clang-format v11) (#176) Co-authored-by: jrmadsen <jrmadsen@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
55f2dabbb3
Коммит
7a8931e57f
@@ -90,7 +90,7 @@ get_accurate_clock_id_impl()
|
||||
}
|
||||
|
||||
uint64_t
|
||||
get_clock_freq_ns_impl(clockid_t _clk_id)
|
||||
get_clock_period_ns_impl(clockid_t _clk_id)
|
||||
{
|
||||
constexpr auto nanosec = std::nano::den;
|
||||
|
||||
@@ -110,9 +110,7 @@ get_clock_freq_ns_impl(clockid_t _clk_id)
|
||||
<< ") returned very low frequency (<1Hz)";
|
||||
}
|
||||
|
||||
auto&& _period =
|
||||
(static_cast<uint64_t>(ts.tv_sec) * nanosec) + static_cast<uint64_t>(ts.tv_nsec);
|
||||
return nanosec / _period;
|
||||
return (static_cast<uint64_t>(ts.tv_sec) * nanosec) + static_cast<uint64_t>(ts.tv_nsec);
|
||||
}
|
||||
|
||||
std::vector<std::string>
|
||||
|
||||
Ссылка в новой задаче
Block a user