Skip to content

Commit

Permalink
nghttpx: Use std::chrono::duration_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Feb 16, 2017
1 parent ace40f2 commit 83fd72c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/shrpx_log_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ void LogConfig::update_tstamp_millis(

void LogConfig::update_tstamp(
const std::chrono::system_clock::time_point &now) {
auto t0 = std::chrono::system_clock::to_time_t(time_str_updated);
auto t1 = std::chrono::system_clock::to_time_t(now);
if (t0 == t1) {
if (std::chrono::duration_cast<std::chrono::seconds>(
now.time_since_epoch()) ==
std::chrono::duration_cast<std::chrono::seconds>(
time_str_updated.time_since_epoch())) {
return;
}

Expand Down

0 comments on commit 83fd72c

Please sign in to comment.