Skip to content

Commit

Permalink
Revert behavior change on current_time_since_unix_epoch (#5213)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany authored and JesusPoderoso committed Sep 23, 2024
1 parent 5431c71 commit bef43f7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/cpp/utils/time_t_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@ static void current_time_since_unix_epoch(
{
using namespace std::chrono;

static const auto init_time_since_epoch = system_clock::now().time_since_epoch();
static const auto init_steady_time = steady_clock::now();

// Get time since epoch
auto t_elapsed = steady_clock::now() - init_steady_time;
auto t_since_epoch = init_time_since_epoch + t_elapsed;
auto t_since_epoch = system_clock::now().time_since_epoch();
// Get seconds
auto secs_t = duration_cast<seconds>(t_since_epoch);
// Remove seconds from time
Expand Down

0 comments on commit bef43f7

Please sign in to comment.