nghttpx: Use std::chrono::duration_cast
This commit is contained in:
parent
ace40f298d
commit
83fd72c97e
|
@ -112,9 +112,10 @@ void LogConfig::update_tstamp_millis(
|
||||||
|
|
||||||
void LogConfig::update_tstamp(
|
void LogConfig::update_tstamp(
|
||||||
const std::chrono::system_clock::time_point &now) {
|
const std::chrono::system_clock::time_point &now) {
|
||||||
auto t0 = std::chrono::system_clock::to_time_t(time_str_updated);
|
if (std::chrono::duration_cast<std::chrono::seconds>(
|
||||||
auto t1 = std::chrono::system_clock::to_time_t(now);
|
now.time_since_epoch()) ==
|
||||||
if (t0 == t1) {
|
std::chrono::duration_cast<std::chrono::seconds>(
|
||||||
|
time_str_updated.time_since_epoch())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue