Skip to content

Commit

Permalink
add std before abs. fix indentation (use spaces instead of tabs)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilpazintel committed Jan 7, 2025
1 parent 9e71f96 commit 0fb3144
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/rendering.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace rs2
_delta(0),
_last_timestamp(0),
_num_of_frames(0),
_last_frame_counter(0)
_last_frame_counter(0)
{}

fps_calc(const fps_calc& other)
Expand All @@ -76,7 +76,7 @@ namespace rs2
std::lock_guard<std::mutex> lock(_mtx);
if (++_counter >= _skip_frames)
{
if (abs(_last_timestamp) > std::numeric_limits<double>::epsilon() && frame_counter > _last_frame_counter)
if (std::abs(_last_timestamp) > std::numeric_limits<double>::epsilon() && frame_counter > _last_frame_counter)
{
_delta = timestamp - _last_timestamp;
_num_of_frames = frame_counter - _last_frame_counter;
Expand All @@ -91,7 +91,7 @@ namespace rs2
double get_fps() const
{
std::lock_guard<std::mutex> lock(_mtx);
if (abs(_delta) < std::numeric_limits<double>::epsilon())
if (std::abs(_delta) < std::numeric_limits<double>::epsilon())
return 0;

return (static_cast<double>(_numerator) * _num_of_frames) / _delta;
Expand Down

0 comments on commit 0fb3144

Please sign in to comment.