From 22f1199cbca9676eed263d6fd06169a1b7a2d182 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 15 Jul 2015 14:23:47 +0200 Subject: [PATCH] Statistics: initialize starting time at startup --- pdns/common_startup.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index d565133efe..c510e28a0c 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -175,10 +175,10 @@ void declareArguments() ::arg().set("security-poll-suffix","Domain name from which to query security update notifications")="secpoll.powerdns.com."; } +static time_t s_start=time(0); static uint64_t uptimeOfProcess(const std::string& str) { - static time_t start=time(0); - return time(0) - start; + return time(0) - s_start; } static uint64_t getSysUserTimeMsec(const std::string& str) -- 2.47.2